1

There are lots of libraries for javascript client side code coverage, but surprisingly I've yet to find one supporting source maps.

I'm coding in ES6, and would like to see the ES6 coverage results instead of the compiled (and concatenated using browserify) coverage results.

Plugins are fine. I've so far looked at blanket.js and Istanbul, but niether appear to even mention source maps.

4
  • So you want to see coverage in terms of the original program source text, not the minified one? (Seems pretty reasonable) Why can't you just run the unminified version for testing purposes? – Ira Baxter Feb 22 '15 at 9:50
  • @IraBaxter It's the ES6 compile step that's necessary here. – simonzack Feb 22 '15 at 9:52
  • So if you could instrument the ES6 code, and compile the instrumented code, that would work? – Ira Baxter Feb 22 '15 at 9:55
  • @IraBaxter I did get it to work eventually with something alone those lines, I've posted up an answer. – simonzack Feb 22 '15 at 9:56
0

I eventally got this to work using isparta, which is a ES6 instrumenter for istanbul using 6to5 (now named babel).

Debugging is still impossible since source maps in necessary in that case, but we can work-around this by doing 2 builds.

Not the answer you're looking for? Browse other questions tagged or ask your own question.