1

在我的 JavaScript 项目(没有反应)中,我使用 testing-library(没有 Jest)、jsdom 和 jsdom-global 来实现我的测试。但是当我运行这个命令时:

mocha --require jsdom-global/register

我收到这个错误

(node:7696) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.help (C:\Users\carlos.bravo\Desktop\proyectoArea51\area51-frontend\node_modules\yargs\lib\usage.js:240:22)
    at Object.self.showHelp (C:\Users\carlos.bravo\Desktop\proyectoArea51\area51-frontend\node_modules\yargs\lib\usage.js:432:15)
    at Array.<anonymous> (C:\Users\carlos.bravo\Desktop\proyectoArea51\area51-frontend\node_modules\mocha\lib\cli\cli.js:53:13)
    at Object.fail (C:\Users\carlos.bravo\Desktop\proyectoArea51\area51-frontend\node_modules\yargs\lib\usage.js:41:17)
    at C:\Users\carlos.bravo\Desktop\proyectoArea51\area51-frontend\node_modules\yargs\lib\command.js:246:36
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7696) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:7696) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我应该使用什么命令?

4

0 回答 0