yaogengzhu / daily-share

个人博客记录、内容在issues
30 stars 4 forks source link

使用 mocha 的一些记录 (2023-8-10) #190

Open yaogengzhu opened 1 year ago

yaogengzhu commented 1 year ago

问题1 : For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves

报错: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. My test code is, I have the done call back but still getting the error to call the done();

解决方案:

  "test": "NODE_ENV=test mocha --timeout 100000 --harmony --reporter spec --require should */*.test.js"

解决地址