我正在创建一个 Express API,一切都很顺利,直到我开始遇到一些测试问题。我使用 Jest 和 Supertest 来测试端点,但我不知道为什么在运行测试时开始出现此消息。
\n FAIL src/modules/ingredients/tests/updateingredient.test.ts\n \xe2\x97\x8f Test suite failed to run\n\n A jest worker process (pid=672269) was terminated by another process: signal=SIGSEGV, exitCode=null. Operating system logs may contain more information on why this occurred.\n\n at ChildProcessWorker._onExit (node_modules/jest-worker/build/workers/ChildProcessWorker.js:366:23)\n\n(node:672290) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added to [_0x323dee]. Use emitter.setMaxListeners() to increase limit\n(Use `node --trace-warnings ...` to show where the warning was created)\nRun Code Online (Sandbox Code Playgroud)\n我正在使用 Redis 进行缓存和速率限制,我知道它必须与其相关,但我不知道如何修复它。这些错误仅在端点测试时发生。最奇怪的是,这些错误仅在我在 VSCode 打开的情况下运行测试时显示,当我从外部终端运行测试并且 VSCode 关闭时,所有测试都会通过。
\n我已经使用 --detectOpenHandles …