Test Driven Development Tutorial with Factorial Example.
Code examples and walkthrough of how to write unit test using TDD approach.
After to set up the examples please read Factorial TDD and follow the step by step examples.
The project is written in JavaScript using JEST Unit Testing Framework.
Node JS and NPM is required to run the examples. Clone or download the source code in your computer. Run NPM install inside the project folder.
npm install
Please read Factorial TDD Follow the step by step examples.
All the reference tests and Implementations are located under reference-test
and reference-src
folders.
Tests are located under test
folder.
Implementations are located under src
folder. Which you will write.
JEST unit testing framework is used in the project but can be replaced with any library you want.
You can run the tests in your IDE or in the command line.
To run all the test with NPM.
npm test
or to run a single test suite with JEST
jest /test/factorial.test.js
- 1.0.0
- Article.
- Code Examples
- 1.0.1
- Updates to structure and article.
- Minor fix in the package name.
Distributed under the MIT license. See LICENSE for more information.
I am hoping the code and article I shared is helpful. You can always reach me for any questions, comments.
Kem Apak : http://www.softwarenotes.net : @softwarenotes : https://github.com/kemapak