Generic JavaScript codecoverage example

Simple example of JavaScript test with code coverage

Goal

Create a unit test where code coverage is measured and has the possibility to fail when coverage becomes to low.

Running

First run

npm install

Successful test run with sufficient coverage

npm run test

Successful test run with insufficient coverage

npm run test-coverage-fail