How to change the default timeout for mocha tests?
The default timeout for mocha tests is 2000 ms. There are multiple ways to change this:
Change timeout for a single test case
describe("testing promises", function () {
    this.timeout(5000);
    it('test1', function(){ ... });
});
describe("testing promises", function () {
    it('test1', function(){
        this.timeout(5000);
        ...
     });
});
describe("testing promises", () => {
    it('test1', () => {
        ...
     }).timeout(5000);
});
Change timeout for all the test cases
"scripts": {
  "tests": "./node_modules/mocha/bin/mocha 'test/**/*.spec.js' --timeout 5000",
},
mocha.setup({ timeout: 5000 });
 
    