我正在遵循此 tutorial 的第 1 步
我有以下文件夹结构:
├── lib
│ ├── json
│ │ ├── messages.json
│ │ └── testMessages.json
│ └── model.js
├── test
│ └── model.test.js
└── package.json
我的 package.json
有以下运行 Mocha 测试“test”: “mocha -r esm ./test/* —exit”,
但我收到以下错误> backend@1.0.0 test /Users/lee33ya/Desktop/mern-app/backend
> mocha -r esm ./test/* --exit
Error: No test files found: "./test/*"
npm ERR! Test failed. See above for more details.
我做错了什么,我能做些什么来解决我的测试没有运行的问题?我的 github
最佳答案
发现两个问题
关于mocha.js - 为什么在运行 mocha 时找不到我的测试文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64926661/