mocha测试报错Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
问答
如题,mocha测试时如上错误该怎么解决? 找到两个有关,但是没有看懂。。 http://stackoverflow.com/questions/29183191/using-empty-function-in-mocha-js http://stackoverflow.com/questions/29183479/how-to-run-a-selenium-test-in-mocha
回复 (4)
J
mocha测试时默认是2秒的最大执行时间,如果该测试用例执行超过2秒则会报错, 可以在当前执行的用例的describe 的回调中加上一句 this.timeout(xxx) 单位是毫秒 来更改最大执行时间
D
楼上+1 cli命令也支持参数设置最大timeout
mocha -t 5000
X
X
引用 dayuoba楼上+1 cli命令也支持参数设置最大timeout
@dayuoba 谢谢
参与回复
登录后即可参与回复。登录