How to programmatically skip a test in mocha?
I have a code where certain tests will always fail in CI environment. I would like to disable them based on an environment … Read more
I have a code where certain tests will always fail in CI environment. I would like to disable them based on an environment … Read more
If we have a unit test file my-spec.js and running with mocha: mocha my-spec.js The default timeout will be 2000 ms. It can … Read more
I’m trying to figure out on how to test internal (i.e. not exported) functions in nodejs (preferably with mocha or jasmine). And i … Read more
In my node application I’m using mocha to test my code. While calling many asynchronous functions using mocha, I’m getting timeout error (Error: … Read more
Mocha tries to find test files under test by default, how do I specify another dir, e.g. server-test? 15 Answers 15
Why does the following fail? expect([0,0]).to.equal([0,0]); and what is the right way to test that? 7 Answers 7
I’m having issues getting Chai’s expect.to.throw to work in a test for my node.js app. The test keeps failing on the thrown error, … Read more
I am using Mocha for testing my NodeJS application. I am not able to figure out how to use its code coverage feature. … Read more
I use Mocha to test my JavaScript stuff. My test file contains 5 tests. Is that possible to run a specific test (or … Read more
I’m submitting a network request in a test case, but this sometimes takes longer than 2 seconds (the default timeout). How do I … Read more