我正在测试使用 jest 构建一个带有汇总的包,每当我使用 async/await 时都会抛出错误。我不知道出了什么问题。我尝试了不同的灵魂,但它不起作用。
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at loadCjsDefault (node_modules/@babel/core/lib/config/files/module-types.js:77:18)
at loadCjsOrMjsDefault (node_modules/@babel/core/lib/config/files/module-types.js:49:16)
at loadCjsOrMjsDefault.next (<anonymous>)
at readConfigJS (node_modules/@babel/core/lib/config/files/configuration.js:190:47)
at readConfigJS.next (<anonymous>)
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at _parser (node_modules/@babel/core/lib/parser/index.js:9:16)
at parser (node_modules/@babel/core/lib/parser/index.js:54:18)
at parser.next (<anonymous>)
at normalizeFile (node_modules/@babel/core/lib/transformation/normalize-file.js:93:38)
at normalizeFile.next (<anonymous>)
? Cannot log after tests are done. Did you forget to wait for …Run Code Online (Sandbox Code Playgroud)