0

I'm doing browser unit testing via Intern. Because we like to write in the CommonJS format, I'm browserifying the code into a module that can then be loaded by the Dojo AMD loader. However, the code coverage reports are also reporting on the bundled code.

One option I've seen for this is to preinstrument the code, and tell istanbul to ignore certain require statement. After trying that, it appears that Intern is still instrumenting the code again.

Can I tell intern to NOT instrument the code, if I've done that before hand, but still collect the coverage data somehow? Or is there another option possible?

1 Answers1

0

This question led me to a possible solution: How do I run functional tests in Intern against a backbone app being served up by rails?

If code is instrumented before being passed to intern using an istanbul coverageVariable of __internCoverage, then intern won't instrument it again. In my case, I'm able to use a modified version of browserify-istanbul to instrument the code with this variable, then then intern does exactly what I want - creates the reports, but doesn't re-instrument it.

Community
  • 1
  • 1