Questions tagged [karma-coverage]

A plugin for Karma (code test runner) that generate code coverage.

A plugin. Generate code coverage.

295 questions
0
votes
1 answer

Karma report browser subfolders

I am using karma to run my javascript tests, and to generate a coverage report. Here is my coverage configuration from the karma.conf.js: coverageReporter: { dir : 'coverage/', reporters: [ { type: 'text-summary' }, {…
Bojana Popovska
  • 571
  • 1
  • 4
  • 15
0
votes
1 answer

How can I exclude browserify generated code from code coverage numbers?

I use browserify to bundle all our angular js code into one file. We use karma + jasmine to unit test this one file, app.js. As part of the bundling that browserify does, it injects a single line of code at the beginning of the file: (function…
josh
  • 1,231
  • 1
  • 12
  • 28
0
votes
1 answer

`Can not load "coverage"!` message when trying to run Karma Coverage

The reason I raise this question is because the only Q/As I can find on StackOverflow is to do with the plugin not being found, where the solution is to add to the list of plugins. However, this is different, as the plugin is being found…
Hopeful Llama
  • 728
  • 5
  • 26
0
votes
1 answer

How to check whether a src file or spec has been loaded by karma or not?

I am running karma test runner for jasmine test suites. I am not sure whether my source and spec files are being loaded are not. How to check whether a src file or spec has been loaded by karma or not?
Chetan Kumar
  • 397
  • 3
  • 13
0
votes
1 answer

SonarQube not reading javascript test coverage from lcov

I'm working on integrating Karma tests in maven and using SonarQube for test coverage reporting. While i'm able to view HTML karma test coverage reports(coverage type HTML in karma.conf.js), i'm not able to view the results in SonarQube when the…
SubSul
  • 2,523
  • 1
  • 17
  • 27
0
votes
1 answer

Angular 1.x Browserify Jasmine how to set up code coverage test?

I am using Angular (1.x) with Browserify, and Jasmine as test framework. I would like to run code coverage test. I researched online and it's a little here and there and some of the examples doesn't work. I was wondering if any people have the…
WABBIT0111
  • 2,233
  • 2
  • 18
  • 30
0
votes
2 answers

Why does my coverage report show covered lines in red?

I am able to use Karma, Tape, and Istanbul (specifically, babel-istanbul) to get what look like correct coverage reports of my ES6 codebase, but the HTML report shows some covered lines in red, even as it shows in the margin that they have been…
Roni Choudhury
  • 486
  • 4
  • 15
0
votes
1 answer

isparta module not loading properly so can't run test cases

My tests used to run absolutely fine, but all of a sudden I'm getting the following error while running tests. Please help. I'm stuck on this for two days. It's a react project. I'm using web-pack and babel. Using isparta for code-coverage. …
sapy
  • 8,952
  • 7
  • 49
  • 60
0
votes
1 answer

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,…
Lord Midi
  • 754
  • 1
  • 9
  • 25
0
votes
1 answer

npm -g install karma-cli gives error (Karma/AngularJS)

I have successfully run sudo npm install -g karma in addition to installing all the necessary dependencies/preprocessors. My karma config file can be seen: module.exports = function(config) { config.set({ rootElement: '#receiveQuote', …
Iqen
  • 139
  • 1
  • 9
0
votes
1 answer

unit test for if else statement angular js

I want to perform unit test on the if else statement so that the branch section of the code coverage gives good result.I am not getting the idea as in what exactly should be tested in the code below Controller.js (function () { "use strict"; …
user2128
  • 590
  • 2
  • 13
  • 35
0
votes
1 answer

code coverage for each source file using karma-coverage and angularjs

I am trying to setup the code coverage for the unit test for the angular project. However it gave me some error. Refer https://github.com/angular-class/NG6-starter/issues/58
0
votes
0 answers

AngularJS Unit testing directive

I am doing an AngularJS unit test and use Karma - Coverage to see the result. Here is my code. todomvc.directive('todoBlur', function () { return function (scope, elem, attrs) { elem.bind('blur', function () { …
0
votes
1 answer

Karma-coverage : Object has no method isIdentifierPart

I want to use Karma for code coverage on my JQuery Mobile project and QUnit or Jasmine for tests. I have installed all the node packages I need (karma, karma-cli, karma-coverage, jasmine/qunitjs, karma-chrome-launcher) and created the following…
axvo
  • 829
  • 2
  • 12
  • 25
0
votes
1 answer

How to setup unit testing for multiple require module

I am working on a code base, where code is divided into multiple require modules. ie each section has its own main.js with the require configuration. I want to setup code coverage for the whole code base using Karma. Since each section has its own…
Ravi
  • 323
  • 2
  • 6
  • 18
1 2 3
19
20