WatchG模式下带有异步笑话测试的NodeGit超时

时间:2019-01-25 13:22:08

标签: unit-testing jestjs nodegit

我要解决一个奇怪的问题。

// in __mocks__/nodegit
const { Repository } = require('nodegit');
module.exports = {
  Clone: async (url, target) => Repository.open(target),
};

// my test -> simplified
const { Clone } = require('nodegit');
describe('GitHandler ', () => {
  it('fails', async () => {
    const repo = await Clone('fooo', 'test/repository');
    expect(repo).toBeDefined();
  });
});

当我开玩笑地在正常模式下运行时,每次都很好。当我在观看模式下启动玩笑时,它几乎每隔第二次就一直失败。

Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

我该怎么办?

0 个答案:

没有答案