This project demonstrates how to perform unit testing on a JavaScript project using Mocha and Chai for testing, Rewire for module mocking, and NYC for code coverage.
Install required dependecies
yarn
-
Write your unit tests in the
testdirectory. Follow the naming convention<module-name>.test.js. -
Use Mocha and Chai for writing test cases. You can create test suites with
describeand write test cases withit. -
Utilize Rewire to mock and override module dependencies for isolated unit testing.