Just a quick explanation of how tools instrument your JavaScript code to
record and report code coverage. Common tools:
istanbulnyc with ava are great for coverage of node-running tests (use jsdom to mock a DOM like I do).babel-plugin-__coverage__karma-coverage with karma and the babel plugin are great for coverage of code when you want to run your tests in a browserisparta (no longer maintained, try the babelplugin)
You may also be interested in this video + this repo where I go through setting up code coverage with ES6, Webpack, and Karma. Just replace where I use isparta with using babel-plugin-__coverage__ (like this) and it should work great ๐