This is the fifth project in the second module in the Microverse program.
Check the below contents for further details about this project.
This project is an exercise for practicing unit testing using Jest framework with TDD (Test Driven Development).
It contains two directories units for functions & testers for testing functions.
It also includes config linters for JavaScript in the .github directory.
📌 Tech Stack:
- Logic & functionality built with
JavaScript - Unit testing done with
Jestframework
📌 Key Features:
- Each task has its own unit & tester file
- All tasks are in separate test group with description text
- Function
stringLengthreturns a number for the input string length - Any string length outside the range of
(1 - 10)throws an errorValue out of range! - Three test cases are implemented in
stringLength.test.jsfor checking valid & invalid input - Function
reverseStringreturns the input string with characters in reverse order - One test case was done for
reverseStringfunction inreverseString.test.js - Object
calculatorcontains four functions (add/subtract/multiply/divide) - Each function inside the
calculatorobject has three test cases grouped together - Function
capitalizetakes a string input & returns it with first letter capitalized - The test cases for
capitalizefunction was created first incapitalize.test.js - Any number input for
capitalizefunction thriws an errorInvalid string!
You can easily clone or fork this repository and work on it immadiately!
📌 Prerequisites:
NodeJSfor installing & running all packagesJesttesting framework installed with:
npm i -D jest
📌 Setup:
- Install all dependencies with
npm - For running tests use:
npm run test
📌 Mahammad:
Wish to contribute to this project?
Contributions, issues, and feature requests are more than welcome!
Feel free to check the issues page too.
Like this project? Show your support by starring!
I thank everyone at Microverse for guiding me through this project.
This project is MIT licensed.