0

I know there is an existing post asking if it's possible to generate an HTML report of code coverage analysis for tests written and run with Intern, and it's been answered:

Generate HTML code coverage reports with intern

However, the post doesn't mention what type of environment that the OP runs in; i.e., are the tests running in a Node.js client? I ask because I am running my unittests using the Intern framework in a browser [edit: invoking tests comparably to http://path/to/intern-tutorial/node_modules/intern/client.html?config=tests/intern]. The article here:

https://github.com/theintern/intern/wiki/Using-and-Writing-Reporters#custom-reporters

outlines that HTML is the only reporter available for the browser platform; LCOV and LCOVHTML are not. But has that changed at all? This limited array of reporters for browsers isn't very convenient, and I was hoping to take advantage of Istanbul built into Intern, rather than try to plug in another code coverage analysis tool (or hack my own thing :( ).

Community
  • 1
  • 1
sparkles
  • 33
  • 6

1 Answers1

0

Code coverage information will be correctly retrieved from code running in browsers if you run your tests with intern-runner. The actual collation and output of the coverage results occurs on the server (Node.js) side.

C Snover
  • 17,908
  • 5
  • 29
  • 39
  • Sorry if I wasn't clear in my question. When I say that I run my tests in a browser, I mean I use the client.html file to kick them off. i.e., comparable to what the tutorial refers to with http://path/to/intern-tutorial/node_modules/intern/client.html?config=tests/intern Are you saying that it's only possible to get coverage results from using what I think the tutorial refers to as the "test runner"--i.e., intern-runner.js, and *not* from invoking tests through client.html? I guess I'm tripping up on semantics since I'm so new to testing with Intern. – sparkles Feb 01 '15 at 05:11
  • Yes, using `intern-runner` is the only official way to get code coverage information. It’s technically possible to use client.html to generate coverage reports, but you would need to pre-instrument your code in that case. Maybe it’s something to investigate for the future. We’d accept patches in this area. – C Snover Feb 02 '15 at 06:04