Member-only story
Testing Redux code with Mocha
What is the test case?
Well, a test case is nothing but a set of conditions under which a developer or tester can test whether the system is fully functional or not.
Why test case?
This is the most asked question by a developer who never wrote a test case before. Writing test cases are boring when you’re new to it. It may feel every time, why am I writing test cases? Well, trust me it’s the same I felt when I start learning and writing test cases, initially. Let me write the benefits about it point by point.
1. Test design helps you design how the product will be tested much like how the product is developed to work.
2. It’s a repeatable process very useful when a new tester comes.
3. You can see the whole view of your design which isn’t covered in requirements.
4. The workflow is clear when you see the test cases.
The main benefit of writing test cases is in the activity of writing them.
Now we know, why we will write test cases. Let’s dive into the code. I recommend Mocha as a testing engine. It runs in a Node Environment.
It’s very simple to install, run the command below in the project
npm install --save-dev mocha