Types of tests Unit Tests test very specific, low-level pieces of functionality for example if a function returns the expected value. Integration Tests ensure that the individual pieces of your application work together correctly. For example if a method invocation successfully calls an API which in turn stores a value in the database. Single-service integration […]

This article will demonstrate how to test JavaScript files in NodeJS using the libraries Sinon, Mocha and Chai. Sinon is often installed together with Mocha and Chai, but it is not required.

Setup Fakes, spies and stubs are created in the default sandbox which needs to be restored after each test to prevent memory leaks. We use a Mocha hook plugin for that: Types of test doubles Type What it does Behavior Pre-programmed behavior Pre-programmed expectations When to use Fake records arguments, return value, the value of […]

Installation Change into your project root folder (package.json must exist) and run Verify that it was correctly installed by running Cypress: or in case this makes trouble (it did for me, see below) run that instead: For convenience you can add a script to package.json: The official docs provide further info about installation such as […]

We are going to have a look at how you can test your React Components and your Redux reducers and actions.