Jest: Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

jest 24.0版本 以下

test("getNetworkInfo toThrow1 接口", async ()=> {
    console.log("getNetworkInfo 2" + add)
    await expect(wrapper.vm.getNetworkInfo(2)).rejects.toThrow("error")
  }, 20000)
image.png

jest 24.0版本 以上

// jest.config.js
module.exports = {
  setupFilesAfterEnv: ['./jest.setup.js']
}

// jest.setup.js
jest.setTimeout(30000)
image.png

你可能感兴趣的:(Jest: Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.)