代码之家  ›  专栏  ›  技术社区  ›  JenuRudan

Mocha with Mongoose、async、Wait

  •  0
  • JenuRudan  · 技术社区  · 8 年前

    我正在使用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);
        });
    
    });
    
    1 回复  |  直到 8 年前
        1
  •  1
  •   nihartrivedi810    8 年前

    您可能需要增加摩卡测试的超时时间

    例如:

    mocha src/**/*.test.js --timeout 15000