jimivdw / grunt-mutation-testing

JavaScript Mutation Testing as grunt plugin. Tests your tests by mutating the code.
MIT License
51 stars 11 forks source link

can't run mutation tests when using karma-coverage plugin #56

Open yooyiten opened 8 years ago

yooyiten commented 8 years ago

I'm having trouble with this plugin when also using the karma-coverage plugin.

If I don't add karma-coverage to my karma conf file, I can run my tests with karma and also the mutation tests without issue. If I add the karma-coverage plugin, I can run my tests with karma and get the coverage report, but I can no longer run the mutation tests and I get errors like:

29 02 2016 17:20:21.646:WARN [mutation-testing-karma]: Could not find specs for file: /var/folders/rr/cbmh00gx3rn0_869mnd1n7g40000gn/T/mutation-testing116129-57978-fpmsst/public/javascripts/controllers/waterfallController.js
29 02 2016 17:20:21.646:WARN [mutation-testing]: Could not properly set up Karma server for file: /var/folders/rr/cbmh00gx3rn0_869mnd1n7g40000gn/T/mutation-testing116129-57978-fpmsst/public/javascripts/controllers/waterfallController.js, skipping...
/public/javascripts/controllers/waterfallController.js could not properly set up Karma server

I encountered the same thing when trying to run the mutation tests in https://github.com/lvandiest/mutation-test-demo, which also makes use of the karma-coverage plugin.

melaniehoyer commented 8 years ago

Thank you so much @yooyiten! Now the https://github.com/lvandiest/mutation-test-demo also works for me! (I also had to re-install phantomjs and grunt-karma for the demo)

jimivdw commented 8 years ago

Hi @yooyiten,

Could you tell me the exact versions of karma, karma-coverage, and NodeJS you used? This might help us pinpoint the exact cause of the issues you're having.

Side note: it is working for me with the latest versions of karma and karma-coverage on node 0.10

yooyiten commented 8 years ago

This is with node 5.6.0 and here are the devDependencies:

"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-sass": "^0.9.2",
"grunt-contrib-watch": "^0.6.1",
"grunt-karma": "^0.12.1",
"grunt-mutation-testing": "^1.3.1",
"jasmine-core": "^2.4.1",
"karma": "^0.13.21",
"karma-coverage": "^0.5.3",
"karma-jasmine": "^0.3.7",
"karma-phantomjs-launcher": "^1.0.0",
"phantomjs-prebuilt": "^2.1.4"

I just tried using node 0.10.43 and the issue still occurred.