Change default timeout for mocha

后端 未结 4 971
臣服心动
臣服心动 2020-11-29 22:25

If we have a unit test file my-spec.js and running with mocha:

mocha my-spec.js

The default timeout will be 2000 ms. It can be overwritten

4条回答
  •  臣服心动
    2020-11-29 23:25

    Just adding to the correct answer you can set the timeout with the arrow function like this:

    it('Some test', () => {
    
    }).timeout(5000)
    

提交回复
热议问题