我正在学习如何用笑话编写测试,当我运行它们时,我得到了这个巨大的日志退出。
\n\n由于它是一个很小的代码,因此我认为将其完全发布没有问题。
\n\ndescribe(\'First test\', async () => {\n const OLD_ENV = process.env;\n\n beforeEach(() => {\n jest.resetModules();\n process.env = { MONGO_CLUSTER_URI: <<<hidden for security reasons>>>\' };\n })\n\n afterEach(() => {\n process.env = OLD_ENV;\n })\n\n test(\'Should pass\', async () => {\n console.log(\'Testing...\');\n const response = await index.handler({ event: \'input\' }, { });\n console.log(response);\n expect(response).toBe(true);\n })\n})\n
Run Code Online (Sandbox Code Playgroud)\n\n我不知道它是否应该给我带来这么大的输出,但我认为它不是,因为它看起来像是抛出了某种错误。我将输出发布在下面,以便你们可以帮助我。
\n\ntvrsky@pc:~/lambda-testes-jest/functions/cf_post_processing$ lerna run test --scope cf_post_processing\ninfo cli using local version of lerna\nlerna notice cli v3.16.4\nlerna info versioning independent\nlerna info filter [ \'cf_post_processing\' …
Run Code Online (Sandbox Code Playgroud) 我正在编写这个 discordbot 并希望它在 github 上。如何在不公开其令牌的情况下上传它?
const Discord = require('discord.js');
const client = new Discord.Client();
// Following is the part that matter, the code before is just to get some context
const token = '[hidden for security reasons]';
Run Code Online (Sandbox Code Playgroud)
我想我应该把它放在一个单独的文件中,但我不知道如何在我的 index.js 文件中引用它。
我该如何解决问题?