

If we need to test Node.js HTTP servers, we usually use SuperTest (it either makes real requests or simulates them while connected to Express.js). chai-as-promised, chai-subset, chai-things). As an assertion tool, we use Chai with its rich plugins (ex. We use Mocha.js to run asynchronous testes, but Chai helps us verify the test results.Ĭhai can be run in a browser or with Node.js. Unit Test Your JavaScript Using Mocha and ChaiĬhai is a TDD and BDD assertion framework for Node.js which can be paired with any testing framework (like Mocha.js we just mentioned).A Quick Guide to mocha.js Test Driven Development (TDD) in Node.js.Both Mocha and Jasmine should be helpful for Ruby developers using RSpec.Piotr Sroczkowski / Full-Stack Developer at Brainhub For writing tests (on all levels: unit, integration and e2e) I use Mocha.js, which is an equivalent of a similar tool – Jasmine.
