Top "Mocha" questions

Mocha.

chai test array equality doesn't work as expected

Why does the following fail? expect([0,0]).to.equal([0,0]); and what is the right way to test that?

node.js mocha chai
How can I check that two objects have the same set of property names?

I am using node, mocha, and chai for my application. I want to test that my returned results data property …

javascript node.js mocha chai
Testing javascript with Mocha - how can I use console.log to debug a test?

I am using the javascript test-runner "Mocha". I have a test that is failing, so I would to debug it …

javascript node.js mocha
How do I properly test promises with mocha and chai?

The following test is behaving oddly: it('Should return the exchange rates for btc_ltc', function(done) { var pair = 'btc_…

node.js promise mocha chai
Testing for errors thrown in Mocha

I'm hoping to find some help with this problem. I'm trying to write tests for an application I am writing. …

javascript testing mocha chai
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 …

mocha
Cleaning up sinon stubs easily

Is there a way to easily reset all sinon spys mocks and stubs that will work cleanly with mocha's beforeEach …

javascript testing mocha stubbing sinon
Babel unexpected token import when running mocha tests

The solutions offered in other related questions, such as including the proper presets (es2015) in .babelrc, are already implemented in …

node.js npm syntax-error mocha babeljs
Mocha tests with extra options or parameters

I am writing test cases for my Node.js application using Mocha. The test cases need an API key as …

node.js mocha
How to access and test an internal (non-exports) function in a node.js module?

I'm trying to figure out on how to test internal (i.e. not exported) functions in nodejs (preferably with mocha …

node.js unit-testing jasmine mocha