Top "Mocha" questions

Mocha.

Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai

So, I'm testing a component that relies on an event-emitter. To do so I came up with a solution using …

javascript node.js promise mocha chai
How to specify test directory for mocha?

Mocha tries to find test files under test by default, how do I specify another dir, e.g. server-test?

unit-testing node.js mocha
Mocha / Chai expect.to.throw not catching thrown errors

I'm having issues getting Chai's expect.to.throw to work in a test for my node.js app. The test …

javascript node.js mocha chai
How to increase timeout for a single test case in mocha

I'm submitting a network request in a test case, but this sometimes takes longer than 2 seconds (the default timeout). How …

mocha
How to run a single test with Mocha?

I use Mocha to test my JavaScript stuff. My test file contains 5 tests. Is that possible to run a specific …

javascript mocha
In mocha testing while calling asynchronous function how to avoid the timeout Error: timeout of 2000ms exceeded

In my node application I'm using mocha to test my code. While calling many asynchronous functions using mocha, I'm getting …

node.js mocha chai
Code coverage with Mocha

I am using Mocha for testing my NodeJS application. I am not able to figure out how to use its …

node.js unit-testing code-coverage mocha
Invariant Violation: Could not find "store" in either the context or props of "Connect(SportsDatabase)"

Full code here: https://gist.github.com/js08/0ec3d70dfda76d7e9fb4 Hi, I have an application where …

reactjs mocha redux
Change default timeout for mocha

If we have a unit test file my-spec.js and running with mocha: mocha my-spec.js The default timeout will …

javascript unit-testing mocha
How do you install and run Mocha, the Node.js testing module? Getting "mocha: command not found" after install

I'm having trouble getting Mocha to work as expected, and I'd love to say as documented, but there (appears) to …

node.js mocha