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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -