Questions tagged [karma-coverage]

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

A plugin. Generate code coverage.

295 questions
13
votes
3 answers

Karma coverage always coming empty

I've been trying to run karma coverage for a couple of days now only to find an empty blank page as below. Here's my configuration: var path = require('path'); var webpackConfig = require('./webpack.common'); module.exports = function (config)…
Joe Saad
  • 1,940
  • 3
  • 22
  • 32
13
votes
3 answers

Code Coverage for Typescript using karma-jasmine and istanbul

I am trying to get the Code Coverage for my typescript Code in karma framework using Istanbul in karma.conf typescript files are included and by karma typescript-preprocessor we able to do unit testing and code coverage of the typescript code but…
Udit S. Ahlawath
  • 131
  • 1
  • 1
  • 6
12
votes
1 answer

Azure DevOps: How to merge two code coverage reports for different tests (.net core, angular)

We have two different types of tests in pipeline: unit(.net core) and frontend (angular/karma). Each of them can publish code coverage report via to "PublishCodeCoverageResults@1", but only one front or back. It depends on which test runs last. I…
12
votes
1 answer

Karma produces lcov report for angular project with invalid line numbers

I have an Angular project with some tests. My build is written in Gulp. I run the tests using Karma and produce an lcov report. I then use the gulp-sonar plugin to run Sonar. My sonar config looks like this: "sonar": { "host": { "url":…
wimnat
  • 1,129
  • 1
  • 13
  • 27
9
votes
2 answers

Angular CLI - Get coverage report to include all sources

I am trying to figure out how to include all my .ts sources in the generated coverage report from the angular CLI. Currently I am only getting coverage for files that have an associated spec with tests against. I have tried adding the…
mindparse
  • 6,115
  • 27
  • 90
  • 191
9
votes
2 answers

SonarQube and Lcov report Could not resolve file paths

We are trying to make a SonarQube code coverage report for our angular application. We have used Karma to generate a code coverage report and import it into SonarQube analyzer. The SonarQube already has C# coverage for our project, now we want to…
Murali Murugesan
  • 22,423
  • 17
  • 73
  • 120
9
votes
1 answer

configure coverage for karma webpack with angular 2

How do I set up karma-coverage with angular2 + webpack? I followed the quickstart webpack guide from angular. But the coverage tool is blank and does not display my tests. Thanks! my folder structure is project |--src (project files) |--tests (all…
Han Che
  • 8,239
  • 19
  • 70
  • 116
8
votes
1 answer

Getting Karma code coverage for pre-transpilation source code

I'm using Karma to run tests, webpack to bundle files, and babel for es6 -> es5 transpilation. I've got the tests running and code coverage being generated, but the code coverage numbers are for the source files after being transpiled. Is there…
Bill
  • 25,119
  • 8
  • 94
  • 125
7
votes
2 answers

How to instrument Angular CLI to report coverage on all source files

When running ng test --code-coverage only coverage for source files that are undergoing tests are reported in the coverage report. How to configure instrumentation to include all source files (e.g. all .ts files in src/app folder)? I have tried…
Hoof
  • 1,738
  • 2
  • 17
  • 39
7
votes
1 answer

Unit Test with karma and webpack: _karma_webpack_ - no such file or directory

I am trying to run a unit test with coverage (using karma-coverage) and webpack (using karma-webpack). The tests run as expected, but to generate a coverage report the actual source file (not the test) needs to be loaded and passed through the…
Sven
  • 12,997
  • 27
  • 90
  • 148
7
votes
1 answer

Getting Karma, 6to5ify and Istanbul to play ball

I have Browserify, 6to5ify and Karma to play nice, successfully running my specs. When I add code coverage however, things go south. I've tried several approaches: Add browserify-istanbul transform to my karma.conf.js. However, this results in it…
Steven
  • 1,566
  • 2
  • 16
  • 38
6
votes
2 answers

Karma code coverage doesn't show in Sonarqube

Issue: Sonarqube coverage is 0% after i configured karma and sonar. Arch: Application use Angular7 and Node v8.14, the integrated Sonarqube is the latest version and JDK is java 11. Issue Desc: these are my local environment, after i configured and…
Rollsbean
  • 715
  • 2
  • 11
  • 31
6
votes
1 answer

Is there a way to show where missed coverage is on karma coverage

I have an Angular app and I'm giving testing a go but it's a nightmare to find where the coverage is needed. the output shows the following: =============================== Coverage summary =============================== Statements : 91.67%…
Liam Clarke
  • 243
  • 4
  • 13
6
votes
0 answers

Include HTML file in Angular unit testing code coverage report

I am using Angular 6 with karma coverage istanbul reporter to see code coverage. It show only .ts file in the code coverage report which could be misleading as HTML templates can also include code logic. Is there anyway to include HTML code to…
developer
  • 1,401
  • 4
  • 28
  • 73
6
votes
1 answer

Error: No provider for InjectionToken USE_DEFAULT_LANG

I am new to angular 4 jasmine unit testing. Kindly help me to get full test coverage for my component attached. I have added child dependencies for translate module but still I am getting Error: No provider for InjectionToken USE_DEFAULT_LANG!…
1
2
3
19 20