小编Ham*_*shi的帖子

超出 Jest Call 重试次数

我在以下测试中出错。我的节点版本是:v12.10.0。有没有 setTimeout 的替代方案?

   test('demo code', async () => {
        const cc = await projectSetup(project);
        const onNotification = jest.fn();
        cc.sendNotification();
        await waitForExpect(() => {
            expect(onNotification).toHaveBeenCalledTimes(2);
        });

    });
Run Code Online (Sandbox Code Playgroud)

错误日志是

Call retries were exceeded

  at ChildProcessWorker.initialize (../../../node_modules/jest-worker/build/workers/ChildProcessWorker.js:230:21)
Run Code Online (Sandbox Code Playgroud)

javascript unit-testing jestjs babeljs

10
推荐指数
2
解决办法
1万
查看次数

标签 统计

babeljs ×1

javascript ×1

jestjs ×1

unit-testing ×1