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
Jest
framework
📌 Key Features:
- Each task has its own unit & tester file
- All tasks are in separate test group with description text
- Function
stringLength
returns 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.js
for checking valid & invalid input - Function
reverseString
returns the input string with characters in reverse order - One test case was done for
reverseString
function inreverseString.test.js
- Object
calculator
contains four functions (add
/subtract
/multiply
/divide
) - Each function inside the
calculator
object has three test cases grouped together - Function
capitalize
takes a string input & returns it with first letter capitalized - The test cases for
capitalize
function was created first incapitalize.test.js
- Any number input for
capitalize
function thriws an errorInvalid string!
You can easily clone or fork this repository and work on it immadiately!
📌 Prerequisites:
NodeJS
for installing & running all packagesJest
testing 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.