Top "Mocha" questions

Mocha.

Files upload testing in Enzyme

I have a FileInput in my render function <FileInput accept= "image/jpeg,image/png,audio/mp3" onChange= {this.fileInputOnChange} …

reactjs mocha sinon chai enzyme
Testing private members in Javascript using Sinon

I'm starting to write some javascript tests and trying to figure out what the best approach is for inspecting the …

javascript testing mocha sinon
chai js expect property value empty array

I'm trying to write a unit test using chai js assertion, and was wondering how to expect arrays with zero …

javascript mocha chai
How to mock a function inside another function (which I am testing) using sinon?

let's say i have a function Func a() { //Do Something let c = b(); return c; } I want to test the …

javascript function mocking mocha sinon
Chai: expecting an error or not depending on a parameter

I've been trying to do a text of a function that handles errors in a way that, if it is …

javascript mocha chai
Use SinonJS to stub and spy on the same function?

In the following example, I want to stub the get function to prevent the actual HTTP request from occurring. I …

mocha sinon
Mocha and ZombieJS

I'm starting a nodejs project and would like to do BDD with Mocha and Zombiejs. Unfortunately I'm new to just …

node.js bdd mocha zombie.js
Loopback testing with supertest, mocha and models

On the Google groups post on deprecating loopback-testing there is a question that asks about providing a proper example of …

node.js mocha loopbackjs supertest
detecting test failures from within afterEach hooks in Mocha

I'm trying to create an afterEach hook with logic that should only fire if the previous test failed. For example: …

javascript node.js mocha
Why doesn't Mocha report time for every test?

Using mocha to do node.js unit tests I get e.g. this output: Suite One: call Home Page √ should …

testing mocha reporting