Programming with JavaScript by meta, this repo is just a brief about jest which was just a part out of this course.
Jest is a JavaScript testing framework designed to ensure correctness of any JavaScript codebase. It allows you to write tests with an approachable, familiar and feature-rich API that gives you results quickly. Jest is well-documented, requires little configuration and can be extended to match your requirements.
- Install node, if not installed.. visit follow https://nodejs.org/en .
- Confirm node installation by typing node --version on any command line.
- Open a folder and launch on your prefferd text editor(I used Vs code).
- Run npm init -y on your terminal for your project directory.
- Then install jest by using this npm i --save-dev jest , this would install jest as a devDependency on your package.json
- Change the test value in your script tag(package.json file) to "jest", something like this "test": "jest".
- For further pratice see my addFive.test.js(used for testing my code) and addFive.js
npm run test
follow this link for jest official page https://jestjs.io/