报错:
Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was
not invoked within the 5000ms timeout specified by jest.setTimeout.
at mapper (node_modules/_jest-jasmine2@24.9.0@jest-jasmine2/build/queueRunner.js:25:45)
描述:
运行测试组件是提示超时,即使skip的组件也超时,甚至运行成功的组件也超时;其他测试用例不超时,只有这个超时
解决过程:
总结
原则:紧紧的扣住报错内容,从报错内容中找线索。
报错内容,提示超时,那肯定是哪里超时了;接下来就是超时的地方;脚本中,各个组件都设置了时间 (35000),一般足够用了,不会发生集体超时(排除了网络问题),所以只能是
beforeAll() 这种地方了。
原文:https://www.cnblogs.com/George19950505/p/12651700.html