How to setup Jest in a project and produce a coverage report.
To run the project open up the terminal and follow these instruction:
$ git clone https://github.com/giopunt/setup-jest-with-coverage.git && cd setup-jest-with-coverage
Then install the dependencies
# npm
$ npm install
# or if you prefer yarn
$ yarn
Then to run the tests use:
# npm
$ npm run test
# yarn
$ yarn test
You will now find a report in the output of your terminal or under coverage/lcov-report/index.html
.