Repository navigation
Conversation
-c and -cv options
this requires expresso like module loading to be work
need to mention require('main') instead require('../lib/main')
once you've added lib folders dependencies as require('depname')
nodeunit will automatically detect it and added the code coverage support
--
-cr option to display coverage results in depth including source code view
eg:- nodeunit -ci tests/ package.json updated with dependencies
|
code coverage would be nice |
|
Yes. that's what I forked this. and you checkout myfork and have a |
|
Yes. that's what I forked this. and you checkout myfork and have a |
|
Any update on this pull request? |
|
Since there is no such update. I'm gonna push forked version of nodeunit to NPM. |
|
Hi arunoda, thanks for your work on this. However, I'm unable to see any coverage output when I run test suites using your updated code. It runs the tests fine, but there's no coverage report. I have the code under test in 'lib' and the tests in 'test'. The tests reference the code in lib by doing require('../lib/foo'). I run the tests by doing "nodeunit -cr test" in the project directory. Am I missing something? |
|
I think we need a solution that doesn't require a particular directory structure. Perhaps 'test' and 'lib' can be defaults, but a way to pass in the paths via the command line seems like a necessary feature. |
|
Yes :) A simple thing On Sun, Oct 30, 2011 at 3:45 AM, Caolan McMahon <
Arunoda Susiripala @arunoda http://twitter.com/arunoda |
|
I agree with you. lib should be default but there should be some option to On Sun, Oct 30, 2011 at 3:51 AM, Bryan Donovan <
Arunoda Susiripala @arunoda http://twitter.com/arunoda |
|
Great work! I do agree with Raynos though, this is a breaking change. It would be better to have this off by default. It might also be nice to be more explicit on which requires are part of the coverage, maybe nodeunit.require("mydep") this would also reduce the chance of breaking current projects. |
|
Found a bug. If you specify more than one file on the command line or use globs on the command line the code coverage will be kicked off multiple times (ie nodeunit tests/*). The problem appears to be that "setUpCodeCoverage" is called once for each file. It should be moved below. |
|
I would love to see this feature becomes true :) Any news about this pull request? |
|
@felipesilva while you wait you might want to checkout this out (https://github.com/nearinfinity/node-covershot) we wrote this to be a framework agnostic coverage tool. |
|
@joeferner wow ;) tks. |
|
mochawrapper I just wrote a node module that automates coverage reporting. It is based on mocha, jscoverage and node's assert. You do not have to modify require or use make or enviornment variables. It is hosted on github: |
|
was this ever merged in? |
|
This is an old issue and there are tools out there that can now do code coverage with nodeunit. In the future it would be nice to offer some easy integration but for now it works. |
Expresso's Code Coverage support added to nodeunit
inorder to use it.
you've define requires as follows
var a = require('a');
instead
var a = require('../lib/a')
Then it'll automatically detect this and added code coverage support.
and display the summery.
If you need more information add -cr option
eg:- nodeunit -cr tests
if you need to ommit Code Coverage you can use -ci option
eg:- nodeunit -ci tests
And this will not affect existing tests written in Nodeunit and above little require modification adds the coverage support