lundi 28 décembre 2015

too high Code Coverage in KarmaJS with karma-coverage & Jasmine

I'm using Jasmine as the testing framework for my AngularJS application. I run the tests with the help of Grunt & KarmaJS. KarmaJS also generates the code coverage with the help of karma-coverage.

Now I've created a model for configuaration data, which I also have to instantiate for other tests. Because of this instantiation I get a code coverage for this file although I haven't done any tests for it. Only because while the test run all of the lines were used, the coverage is 100%.

Now the question: Is there a way to specify in my tests which files they cover?

In PHP Unit there is an @covers annotation which specifies what code is covered with the test.

Thx

Aucun commentaire:

Enregistrer un commentaire