argon icon indicating copy to clipboard operation
argon copied to clipboard

Code Coverage

Open DNoved1 opened this issue 8 years ago • 3 comments

Using Istanbul and Remap-Istanbul.

The basic code flow is:

  • The tests page now instruments all of argon's code with istanbul.
  • Tests are run, as before. This also records coverage information because of the instrumentation.
  • The tests page reports the coverage information along with the transpiled js (from ts), and sourcemaps representing that transpilation down to the node server using socket.io (included with browser-sync).
  • The node server uses remap-istanbul to apply the sourcemaps to the transpiled js in order to get coverage data for the original typescript.
  • The typescript coverage information is turned into a html report at coverage/index.html using istanbul.

DNoved1 avatar Mar 08 '16 06:03 DNoved1

If there's a way to reduce the amount of chnages to the jspm.config.js file, I'd love to know. Simply adding istanbul, escodegen, and esprima seems to have pulled in about 400 lines of configuration information for their dependencies.

DNoved1 avatar Mar 08 '16 19:03 DNoved1

The only way to reduce the amount of dependencies that are pulled in is to add an override in package.json which maps everything you don't need to @empty. I don't think we need any of the nodejs related dependencies since all of our test code runs in the browser. See if you can fix that.

Also, can we have the coverage results output somewhere other than in the src folder?

speigg avatar Mar 10 '16 17:03 speigg

The coverage should be output to the coverage folder, is it being put in the src folder when you run it?

DNoved1 avatar Mar 10 '16 17:03 DNoved1