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

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -