Closed wanasit closed 9 years ago
This is by design, why do you want to include anything else to the coverage report than the file you are testing?
Your qunit, for example, are modulized into several files (in lib
directory) which is linked to the main module -- testrunner.js
. If I run integration tests on exported APIs of testrunner
, I won't get the coverage checking on any other files (ex. coverage.js
, log.js
, generator.js
) which account for a lot of logic.
In my case, I need to use the feature on my project to have coverage report on every file within src
folder. (https://github.com/wanasit/chrono)
npm test
(qunit -c chrono:src/chrono.js -p src -t test-qunit/*.js --cov). src
folder into -p
. With the change I made, qunit will put all the file that match the path (/src) into the coverage.I think you may have a better approach. This PR is just to proposing my problem and the idea.
Well, test-qunit/*.js is not gonna work ... :)
Well.. it does work as expect. You can check the log output here: https://travis-ci.org/wanasit/chrono
haha how that, I haven't used any minimatch implementation ....
I am basically ok with passing additional paths to coverage, but we need to
That looks better. And, it should be compatible with the normal --cov
without params.
And, what was your plan with with -p
originally?
-p don't see it used anywhere ....
Let's close this PR for now. I will take your suggestion and send you a new one. You can also go ahead and implement it if you have time.
BTW. Happy new year.
I discovered that:
--cov
orcoverage=true
) does coverage only the source file, but does not coverage other modules required by the source.-p
or--paths
has not been used anywhere in your code.In this PR, I make the files that match the paths parameter include in coverage report, which I think it could be useful. Please review.