s9tpepper / karma-cucumberjs

A Cucumber.js Karma test runner adapter.
MIT License
54 stars 21 forks source link

the Karma coverage option does not seem to work #10

Closed AndyAtTogether closed 9 years ago

AndyAtTogether commented 10 years ago

it may just be my project but..

when i configure coverage, the instanbul report is generated though none of the files i specify to cover are reported on.

i've test this with some jasmine specs rathern the cucumber.js specs and the jasmine one generate coverage information.

This is a real shame as the coverage information would be the icing on the cake for me

hallvar commented 9 years ago

Until there is a pull request to fix this issue you can try yourself in lib/adapter.js or source/adapter/cucumber_runner.js:

Change from

onCucumberFinished: function onCucumberFinished() {
    karma.complete({});
}

to

onCucumberFinished: function onCucumberFinished() {
    karma.complete({
        coverage: window.__coverage__
    });
}
hallvar commented 9 years ago

If the pull request is not reviewed and accepted a possible solution is to update your package.json to point to my fork and branch with the fix:

In packages.json update to:

"karma-cucumberjs": "git://github.com/hallvar/karma-cucumberjs.git#67e9b759a8",