Simple example of JavaScript test with code coverage
Create a unit test where code coverage is measured and has the possibility to fail when coverage becomes to low.
First run
npm install
Successful test run with sufficient coverage
npm run test
Successful test run with insufficient coverage
npm run test-coverage-fail