In mocha testing while calling asynchronous function how to avoid the timeout Error: timeout of 2000ms exceeded

You can either set the timeout when running your test: mocha –timeout 15000 Or you can set the timeout for each suite or each test programmatically: describe(‘…’, function(){ this.timeout(15000); it(‘…’, function(done){ this.timeout(15000); setTimeout(done, 15000); }); }); For more info see the docs.

Mocha / Chai expect.to.throw not catching thrown errors

You have to pass a function to expect. Like this: expect(model.get.bind(model, ‘z’)).to.throw(‘Property does not exist in model schema.’); expect(model.get.bind(model, ‘z’)).to.throw(new Error(‘Property does not exist in model schema.’)); The way you are doing it, you are passing to expect the result of calling model.get(‘z’). But to test whether something is thrown, you have to pass a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)