Open abierbaum opened 11 years ago
Having the same issue. Would be nice to see coverage in background mode.
@abierbaum thanks for putting a sample together, I'll take a look.
@abierbaum ok I see what you're seeing. Could you do me a favor in that sample project: create a branch that uses grunt-karma
v 0.5.x (uses latest karma)? Would like to rule that out before digging further.
@geddski I was having the same problem and the update seemed to do the trick.
Thank you.
I had a look at the at the sample of @abierbaum that used karma v 0.5.x https://github.com/abierbaum/test_karma/tree/dev/karma_canary and the coverage report is generated by a 'singleRun' task. Has anyone managed to generate the coverage reports when grunt-karma is running in 'background: true' mode?
In my experience using an outdated version is what causes this. Currently I'm using version 0.10.9 of Karma, version 0.1.5 of Karma Coverage and version 0.6.2 of the Grunt Karma plugin; using these versions I succeed in creating coverage reports when the background mode has been activated.
The NPM version that I'm running is 1.3.23.
I still see this same issue with
,karma: {
unit: {
configFile: "test/karma.conf.js",
background: true
}
,ci: {
configFile: "test/karma.conf.js",
singleRun: true
}
}
I get coverage output with the ci
target, but not the unit
one (run as grunt karma:unit watch
).
@NShewmaker can you please check if this might be related to #33 where you were seeing that background=false
was passed even though you specified true
.
:+1: I'd love to see updated coverage reports in console when tdd-ing
I am trying to setup a grunt-based project to use karma with code coverage enabled. For some reason this doesn't seem to be working.
I have setup a sample project that shows the issue: https://github.com/abierbaum/test_karma/tree/dev/add_grunt
If I run:
Then it will run in singleRun mode and the following output as expected.
If instead I try to run using a watch and background: true, I get the following output where karma works, but it doesn't run the coverage.
Any idea how to fix this up?
I am running Ubuntu 12.10 with node v0.10.12. The package versions I am using are shown in the package file: https://github.com/abierbaum/test_karma/blob/dev/add_grunt/package.json