14
在jest.setTimeout指定的5000ms超时内未调用异步回调
我正在使用puppeteer和jest进行一些前端测试。 我的测试如下所示: describe("Profile Tab Exists and Clickable: /settings/user", () => { test(`Assert that you can click the profile tab`, async () => { await page.waitForSelector(PROFILE.TAB); await page.click(PROFILE.TAB); }, 30000); }); 有时,当我运行测试时,一切都会按预期进行。其他时候,我得到一个错误: Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout. at node_modules/jest-jasmine2/build/queue_runner.js:68:21 at Timeout.callback [as …