Change default timeout for mocha

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 for partial test with a command line parameter:

mocha my-spec.js --timeout 5000

Is it possible to change the default timeout globally for all tests?
i.e. the default timeout value will be different from 2000 ms when you call:

mocha my-spec.js

4 Answers
4

Leave a Comment