美文网首页
Jest: Async callback was not inv

Jest: Async callback was not inv

作者: Rokkia | 来源:发表于2020-05-18 22:09 被阅读0次

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 inv

      本文链接:https://www.haomeiwen.com/subject/nidcohtx.html