Top "Mocha" questions

Mocha.

ES2016 Class, Sinon Stub Constructor

I'm trying to stub out a super call with sinon, and es2016 but I'm not having much luck. Any ideas …

javascript node.js mocha sinon babeljs
Chai unittesting - expect(42).to.be.an('integer')

According to http://chaijs.com/api/bdd/#a, a/an can be used to check for the type of a …

javascript node.js unit-testing mocha chai
Using webpack aliases in mocha tests

I'm developing a web app at work in React/Redux/Webpack and am now starting to integrate testing with Mocha. …

reactjs npm mocha webpack redux
Correct way to unit test Express Middleware

I have a piece of Express middleware that is set to check for a valid Content-Type header in all of …

node.js unit-testing express mocha chai
How to resolve "Cannot read property 'should' of undefined" in chai?

I'm trying to test my test my RESTful nodejs API but keep running into the following error. Uncaught TypeError: Cannot …

node.js mocha chai
Spying on a constructor in javascript with sinon

I am trying to create a spy on a constructor, and see if it gets called -- below are my …

javascript mocha sinon
sinon stub not replacing function.

I tried a dummy module and to stub it, but does not work. the app.js function foo() { return run_…

javascript node.js testing mocha sinon
Sinon spy on console.log call not registered

I'm trying to learn about Sinon and want to spy on console.log. The code is simple: function logToConsole() { console.…

javascript testing mocha sinon chai
Why am I getting "Error: Resolution method is overspecified"?

After the upgrade, Mocha can not even run a simple test here is the code const assert = require('assert'); it(…

node.js mocha
Redux How to update the store in unit tests?

Using enzyme, mocha and expect asserts. The aim of my unit test is to check that dispatch gets called with …

unit-testing reactjs redux mocha enzyme