我使用mocha进行测试,当使用async / await时,我得到了
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
我的代码
describe('ClientsMerge', () => {
it('it should get all clients', async () => {
let clients = await Client.find();
console.log(clients);
});
});
答案 0 :(得分:1)
您可能需要的是增加摩卡测试的超时
例如:
mocha src/**/*.test.js --timeout 15000