Top "Mocha" questions

Mocha.

Enzyme simulate an onChange event

I'm testing a react component with Mocha and Enzyme. Here is the component (shortened for simplicity of course): class New …

javascript reactjs mocha enzyme
What is the difference between `before()` and `beforeEach()`?

What specifically is the difference between Mocha's before() and beforeEach()? (Same question for after() and afterEach().) I assume before() runs …

javascript unit-testing mocha
What is the difference between “assert”, “expect”, and “should” in Chai?

What is the difference between assert, expect, and should? When to use what? assert.equal(3, '3', '== coerces values …

javascript mocha chai
Global `before` and `beforeEach` for mocha?

I'm using mocha for javascript unit-testing now. I have several test files, each file has a before and beforeEach, but …

javascript unit-testing mocha
joining tests from multiple files with mocha.js

I'm trying to join all the tests from multiple files in one file, something like this: describe('Controllers', function() { describe(…

node.js unit-testing mocha
How do I programmatically shut down an instance of ExpressJS for testing?

I'm trying to figure out how to shut down an instance of Express. Basically, I want the inverse of the .…

unit-testing testing node.js express mocha
Why do I see "define not defined" when running a Mocha test with RequireJS?

I am trying to understand how to develop stand-alone Javascript code. I want to write Javscript code with tests and …

javascript node.js npm requirejs mocha
Error: This method is only meant to be run on single node. 0 found instead

I am testing a keybinding feature in a component. The component is rather simple, event listener for the keyup and …

reactjs mocha redux enzyme
Is there a way to get Chai working with asynchronous Mocha tests?

I'm running some asynchronous tests in Mocha using the Browser Runner and I'm trying to use Chai's expect style assertions: …

javascript unit-testing mocha
Is there a .mocha file where I can specify defaults such as --no-colors?

I'd like to set some defaults for mocha without having to type them each time. Does mocha look for a …

node.js configuration config mocha dotfiles