mardi 26 mai 2015

How to set MochaJS global timeout in browser

I'm trying to run some UI tests in a headless browser using MochaJS and I can't seem to get the timeout option to set correctly.

I've got the following running in my browser after I've loaded MochaJS:

window.mocha.setup({
    timeout: 10000
}).run();

The tests run, but I keep getting the following for one of my "slower" tests:

message: 'timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.'

I've read the source for MochaJS and AFAIK, the .setup() that I've got above should set the global timeout to 10000ms, but it looks like it's still stuck at the default, 2000ms.

What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire