Top "Chai" questions

Chai is a BDD/TDD assertion library for Node.

How to unit test a method of react component?

I am trying to unit test my reactjs component: Just to get started I am already struggling to assert the …

unit-testing reactjs chai enzyme
Chai: how to test for undefined with 'should' syntax

Building on this tutorial testing an angularjs app with chai, I want to add a test for an undefined value …

javascript angularjs testing chai
Protractor Check if Element Does Not Exist

I have a setting in my angular based website that turns a dropdown on and off. If it is off, …

javascript angularjs protractor chai
Chai - Testing for values in array of objects

I am setting up my tests for the results to a REST endpoint that returns me an array of Mongo …

arrays mocha chai
Post request via Chai

I am trying to make a request to my node JS server which accepts post/put call. The parameters I …

node.js mocha chai
How do I test if a function calls a specific method/function?

Is there a way in Mocha to test if a function calls a specific method or external function? I am …

javascript node.js tdd mocha chai
Verify that an exception is thrown using Mocha / Chai and async/await

I'm struggling to work out the best way to verify that a promise is rejected in a Mocha test while …

node.js async-await mocha chai chai-as-promised
Test a rejection with Chai as promised

I want to test a function returning a promise. In this particular test, the promise is expected to be rejected …

javascript chai
How to unit test express Router routes

I'm new to Node and Express and I'm trying to unit test my routes/controllers. I've separated my routes from …

javascript node.js unit-testing express chai
Testing JS exceptions with Mocha/Chai

Trying to test some code that throws an exception with Mocha/Chai, but having no luck, here's the simple code …

javascript coffeescript mocha chai