A focused, Node.js unit testing, from absolute beginner to very advanced.
I will post my progress during the course here.
This is a quick example project to show how a test environment can be setup in Node.js
It includes the following
- Mocha - testing framework
- Chai - assertion library
- Istanbul - coverage testing
- SinonJs - stubs and splices for mocking data
In this project, it is a small study that I created on the information I obtained from the sources in order to improve myself.
- Navigate into your working directory, run the following commands:
git clone https://github.com/nuri35/node-js-unit-testing.git
to clone repocd node-js-unit-testing.git
to navigate into projectnpm install
to install the dependencies
npm test
will run the Mocha tests, output results and generate reportsnpm run cover
will run the Istanbul coverage tests and output results and generate reports
Command Line Output: Tests Passing