You need to manually configure the fake timer as follows:
describe('failing test', function() { it('test', function(done) { Promise.delay(1000).then(function(){ done();
Btw, mocha has built-in promises support, so an even better way to do this is to fulfill return your promise:
describe('failing test', function() { it('test', function() {
In my experience, mixing promises and done callback style leads to all the problems and making it difficult to track errors. If using promises, try going back to it and look at a library like chai-as-promised . I promise this will make your tests more readable!
BadIdeaException
source share