Top "Mocha" questions

Mocha.

Skipping a test in Cypress conditionally

I'm trying to find out if I'm able to conditionally skip a test it() in my test suite and deal …

javascript mocha cypress
How to mock middleware in Express to skip authentication for unit test?

I have the following in Express //index.js var service = require('./subscription.service'); var auth = require('../auth/auth.…

node.js express mocha sinon proxyquire
Mocha's describe "require() is missing" in WebStorm 11

I've just installed WebStorm 11 and created a new project, however WebStorm is saying that a require() is needed for the …

javascript node.js mocha webstorm
How to make Istanbul generate coverage for all of my source code?

Currently Istanbul is only generating coverage for files that are used in my tests, which is okay, but seems to …

node.js mocha sinon chai istanbul
Jasmine vs. Mocha JavaScript testing for Rails 3.1+

I have experience with Jasmine and do like it quite a bit. Does anyone have experience with both Jasmine and …

javascript ruby-on-rails jasmine mocha
Cannot run Mocha with CoffeeScript

Makefile - Content: REPORTER = dot all: build build: @./node_modules/coffee-script/bin/coffee \ -c \ -o lib src clean: rm -rf …

coffeescript mocha
Use sinon.js to create a "spy object" with spy methods based on a real constructor/prototype

I'm using sinon.js as a way to stub out dependencies in my Mocha tests. I prefer the 'spy' approach …

javascript node.js mocha sinon
How to repeat/loop through mocha tests

I've been working on a few mocha/chai tests, and I still haven't found a good way of running my …

tdd mocha chai
Chai response.body is always empty {}

No matter what my server actually returns, Chai always gives me this exception when I assert response.body: Uncaught AssertionError: …

node.js mocha chai
How to make empty placeholder tests intentionally fail in Mocha?

I'm writing an API in NodeJS and testing using Mocha, Chai and SuperTest. I'm using a typical test-driven approach of …

node.js unit-testing mocha chai