Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我遇到了一个问题,我的 mocha 测试在使用 chai-http 运行后没有完成。Mocha 只是在测试后挂起并最终超时(至少在我的 CI 上)。
事实证明,Mocha (4.0)改变了他们关于终止测试的行为。我发现的最佳解决方法是将--exit标志添加到 npm 脚本以恢复到 4.0 之前的行为。
--exit
... "scripts": { "start": "node server.js", "test": "mocha --exit" }, ...