Top "Mocha" questions

Mocha.

Difference between Karma and Mocha

I am new to the Javascript world, being majorly into OOP. I have tried to look up online for a …

mocha karma-runner karma-mocha
simulate for onClick not working in enzyme

This is a cancel button <div className="cancelFileBtn" onClick={this.props.cancelFileSending}> I need to simulate its click,…

reactjs mocha chai enzyme
How do I test 'normal' (non-Node specific) JavaScript functions with Mocha?

This seems like it should be extremely simple; however, after two hours of reading and trial-and-error without success, I'm admitting …

javascript unit-testing node.js mocha
mocha not running all tests in test dir

This is my folder structure src/ a.js b.js test/ a.spec.js b.spec.js and I've tried …

node.js unit-testing testing mocha chai
Chai expect: an array to contain an object with at least these properties and values

I'm trying to validate that an array of objects like this: [ { a: 1, b: 2, c: 3 }, { a: 4, b: 5, c: 6 }, ... ] contains at least …

javascript mocha chai
Catching gulp-mocha errors

I may be missing something extremely obvious but I can't get gulp-mocha to catch errors, causing my gulp watch task …

javascript mocha gulp
Node Express testing mock res.status(status).json(obj)

I get the following error when trying to test my method: TypeError: Cannot call method 'json' of undefined Below is …

node.js express mocha sinon
How does variable scope work within the Mocha test framework?

I am a relative newbie to all things javascript, node.js, mocha etc. In my code I have a Unit …

node.js scope mocha anonymous-function
Stub moment.js constructor with Sinon

I am not able to stub the moment constructor when calling it with the format function to return a pre-defined …

mocha momentjs sinon chai
Test ethereum Event Logs with truffle

I have a contract's function which emit events on each call. I would like to have an event emitted on …

events logging mocha ethereum truffle