javascript - Mocha async tests, calling done() issue -


i'm developing postcss plugin , want test mocha. here test:

function exec(cb) {     postcss()         .use(regexp)         .process(source)         .then(cb); }  it('should add warnings messages', function(done) {     var expected = 'somemessage';     var message = '';      function getmessage(result) {         message = result.messages;         assert.equal(message, expected);         done();     }      exec(getmessage); }); 

but fails , error: timeout of 2000ms exceeded. ensure done() callback being called in test.

what doing wrong?

your callback not getting called within default timeout of 2000 ms.

if sure there nothing wrong in exec plugin , expected take more 2s , can increase time using

in mocha testing while calling asynchronous function how avoid timeout error: timeout of 2000ms exceeded.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -