Testing example with plain HTML and JS
A simple example of how to use Jest to test pure JS + HTML page. With testing using jest-fetch-mock to test fetch calls.
How to use
Just clone this repo! Then use
npm install to install all needed packages.
All tests are located in
__tests__ folder and you can change Jest's global variable setting in
npm test to go through all tests. Default is set as
jest --watch, you can change this behaviour in
Know your coverage
All coverage report located in
coverage folder and reports are generated by Jest. Run
npm run coverage to get the latest coverage report.
Demo of HTML: View here