I have a client side web application written in basic javascript that should run in a modified chromium browser inside another application. The code is extensively refactored to work in the current setup and updated to use ES6 features. The old version had some browser based mocha testing using Grunt.
I now like to add the tests (and rewrite them if necessary) to the new setup and add code coverage and replace Grunt by npm scripts.
So far I managed to rewrite a number of tests and run them using:
./node_modules/babel-cli/bin/babel.js js --out-dir tmp/js --source-maps
./node_modules/babel-cli/bin/babel.js test --out-dir tmp/test --source-maps
./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/test-spec.html spec <some options>
This gives the output of the tests. They all pass.
Now I'd like to add coverage using nyc but I have no clue how to get it to work. I found mocha-phantomjs-istanbul but this seems to use mocha-phantomjs (deprecated) and istanbul 1.x (deprecated).
What do I need to do to add code coverage to this configuration?