Saturday 13 May 2017

MochaJS doesn' seem to work properly

I'm writing tests for my module with MochaJS. You can see current code here. First time it was running correctly and I added more lines (described advanced). For debugging purposes I wrote

bot.use(function(message, next) {
    console.log(message.text);
    console.log(bot);
    next();
});

Of course I was planning to remove it in final version of code... And here strange things start to take place. It calls function it two or even six times.

I removed piece of above-mentioned code, but it still executes it.

I am running mocha with:

node ./node_modules/mocha/bin/_mocha --no-timeouts

What might be the reason of this problem and how to solve it?



via WildeMe

No comments:

Post a Comment