component-test
component-test copied to clipboard
code coverage?
thoughts on implementing code coverage reporting using yields/coverage?
cli api could resemble:
$ component test {browser,phantom} --coverage
Would be really awesome, also to integrate with node-coveralls Is mocha-phantomjs up for the task?
@Swatinem idk if mocha-phantomjs will support it. setting that up on one my apps is on my todo list. if it's not, i plan on making it -- haha.
It’s been ages since I worked with mocha-phantomjs myself.
https://github.com/metaskills/mocha-phantomjs#jsoncov-reporter
Well there is this. No idea if that can easily be integrated with https://github.com/StevenLooman/mocha-lcov-reporter, to be used by https://github.com/cainus/node-coveralls though.
Code coverage would be awesome.
+1
My current test harness uses CoverJS, but I would like to switch over to component-test because of how nicely it packages all these things together. :)
So I have played with this a bit and come up with: https://github.com/Swatinem/component-istanbul This is just a small module that pipes files through istanbul for instrumentation. Then you can use the extremely ugly command line to get a report:
$ mkdir -p coverage && component test phantom -R node_modules/component-istanbul/reporter.js > coverage/coverage.json && istanbul report
Comments welcome :-)
(oh, and you need the latest PR to have an uptodate mocha-phantomjs)
With my latest PR, you can just pass '--coverage coverage/coverage.json' and it will write to that file. I’m quite happy with that now.