krakenjs/generator-kraken

Awaiting mocha release with fixed timeout(0) regression

Closed this issue · 2 comments

Related to #118 and mochajs/mocha#1300.

Presently, timeout(0) in mocha doesn't act as documented, subsequently breaking out tests. To workaround the issue I pegged mocha to ~1.20 in 0d89749.

Issue to be resolved in the next mocha release as demonstrated by mochajs/mocha@4c0c479 and mochajs/mocha@35da58b.

Passing "-timeout 0" on the command line should disable timeouts, but since timeout(0) doesn't have that effect - all tests fail.

As a workaround, we call enableTimeouts(false) at the beginning of the suite if the timeout is 0:

if (this.timeout() === 0) {
  this.enableTimeouts(false);
}
grawk commented

resolved with #208 (mocha had fixed the core issue a while ago but this PR modifies the this.timeout statements in the tests)