code-coverage | Saves the code coverage collected during Cypress tests | Code Coverage Tools library

 by   cypress-io JavaScript Version: v3.10.5 License: MIT

kandi X-RAY | code-coverage Summary

kandi X-RAY | code-coverage Summary

code-coverage is a JavaScript library typically used in Code Quality, Code Coverage Tools applications. code-coverage has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i @aeolun/code-coverage' or download it from GitHub, npm.

Saves the code coverage collected during Cypress tests

            kandi-support Support

              code-coverage has a low active ecosystem.
              It has 379 star(s) with 101 fork(s). There are 30 watchers for this library.
              It had no major release in the last 12 months.
              There are 85 open issues and 114 have been closed. On average issues are closed in 22 days. There are 37 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of code-coverage is v3.10.5

            kandi-Quality Quality

              code-coverage has 0 bugs and 0 code smells.

            kandi-Security Security

              code-coverage has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              code-coverage code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              code-coverage is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              code-coverage releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              code-coverage saves you 58 person hours of effort in developing the same functionality from scratch.
              It has 275 lines of code, 0 functions and 196 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed code-coverage and discovered the below as its top functions. This is intended to give you an instant insight into code-coverage implemented functionality, and help decide if they suit your requirements.
            • Read from package . json file
            • Include files from the specified coverage file .
            • Resolve absolute path to absolute .
            • find common prefix of files
            • Find source files
            • Prints final coverage files .
            • Find the local files in the project .
            • Get the code pattern to be used to exclude patterns .
            • Show Ny coverage information from the specified file .
            • Check that all file paths are found .
            Get all kandi verified functions for this library.

            code-coverage Key Features

            No Key Features are available at this moment for code-coverage.

            code-coverage Examples and Code Snippets

            No Code Snippets are available at this moment for code-coverage.

            Community Discussions


            Cypress.moment() is not a function on upgrading Cypress version to 9.6
            Asked 2022-Mar-31 at 18:25

            Few test cases in my test suite is failing because I am using Cypress.moment() function in those

            I tried one of the solution mentioned online to upgrade code coverage : npm update @cypress/code-coverage but this did not solved the problem



            Answered 2022-Mar-21 at 18:49


            Why is CodeCoverage.exe producing near empty .coverage Files?
            Asked 2022-Mar-25 at 19:29

            In our Jenkins pipeline, we use SonarQube to report on our code coverage. After running all of our unit/integration tests to produce the .coverage file, we need to analyze this file to create the ".coverage.coveragexml" which is ultimately what is used by SonarQube to interpret the code coverage. We do this by using the CodeCoverage.exe:



            Answered 2022-Mar-25 at 19:29

            It seems the base image we use must have a non-enterprise edition of the Code Coverage tools (which is a requirement). We tested our SonarQube projects commands locally using an enterprise edition of the tools (I have Visual Studio 2022 Enterprise installed on my machine), and the coverage files produced contain the correct data. However, when we used a Visual Studio Professional install, the files are empty just like our Jenkins pipeline.

            As stated, this started happening when the base image was updated - in particular it was around November 8th 2021. It seems the base docker image we were using ( has the latest 2022 tools, but it must not be an enterprise edition - hence the empty files.

            We switched our pipeline over to using dotCover instead to perform the analysis, which works as expected and our SonarQube coverage is back to normal.



            Angular project Karma/Jasmine tests fails on GitHub Action under Google Chrome on Ubuntu
            Asked 2022-Mar-20 at 02:09

            In my Angular project I try to use Google Chrome for testing with Karma & Jasmine in a GitHub Action.

            The Google Chrome start with multiple errors, and then dies after some tests. I tried several tips from StackOverflow ansers in this topic, but nothing helped.

            I use this versions:

            • Chrome 99.0.4844.51 (latest at this time)
            • Karma 6.3.16
            • Angular 13.2.3 (I think it's not relevant, but I don't know)

            I have this karma.conf.js file:



            Answered 2022-Mar-20 at 02:09

            Dunno if GitHub action is same like Jenkins. But on Jenkins you need to run test with --browsers=ChromeHeadless. And the error looks like that GitHub is trying to open Chrome.

            So try to change your test:ci in package.json



            Angular 12 / 13 : Not able to integrate code coverage report with sonarqube
            Asked 2022-Mar-07 at 19:13

            When I run ng test --code-coverage, and then run sonar-scanner, still not able to see coverage report on sonar server.

            I tried setting up new project using Angular 13 and setting up as per official documentation. Still no luck.

            My Sonar server version: Version 9.2.1 (build 49989)

            My Sonar scanner version: 4.7

            My Karma configuration



            Answered 2022-Mar-07 at 19:13
            1. SonarQube has replaced supporting typescript keyword with javascript, since last few versions. Use sonar.javascript.lcov.reportPaths for configuring report path instead of sonar.typescript.lcov.reportPaths in your file.
            2. As per my knowledge, as of now SonarQube is only supporting coverage integration using file. Make sure your karma configuration is generating file at configured path.
            3. For generating lcov format coverage report, you may follow below steps:
            • Using karma-coverage: (Recommended)

              • Make sure (in package.json) you have karma-coverage installed. Generally it is pre-installed with new angular project.
              • Update your karma.conf.js file as below:
                • Add { type: 'lcov', subdir: 'lcov-report' } under karma-coverage reporters.
              • Make sure that you don't have any duplicate configuration.
              • Remove any other coverage reporter and its configuration to avoid conflict.
              • Ideally, your karma.config.js should look like below:



            Nextjs Cypress Only found unit test code coverage
            Asked 2022-Feb-17 at 04:17

            I am trying to add code coverage to cypress following this tutorial

            I added @cypress/code-coverage and babel-plugin-istanbul to my package.json file below



            Answered 2022-Feb-17 at 04:17

            I think it was just a node_modules problem, as your repo worked after download and initialization. I think babel can fail silently if it's dependencies are out of order.

            I removed package.lock (because I use yarn to manage things) and then yarn to init the dependecies.



            PHPUnit can't generate code coverage when running tests in separate processes
            Asked 2022-Jan-21 at 17:05

            I have a problem that I could not find the solution on Google. When I run my unit tests with PHPUnit and Xdebug, I would like to do a code coverage.

            However, when I do that, I get this error:



            Answered 2021-Jul-27 at 11:37

            This is likely because with runTestsInSeparateProcesses, PHPUnit starts a new PHP process for every test. And it seems that it does that without Xdebug loaded.

            The PHP that is started for each test needs to be the same as the one that you originally started PHPUnit with. Perhaps there is a different PHP binary first in the PATH?

            If that is the case, the way to solve it is to make sure the "right" PHP is first in the PATH.



            CircleCI upload to CodeCov cannot find coverage report?
            Asked 2022-Jan-13 at 14:24

            As is no longer free for small open source projects, I am trying to setup CircleCI and CodeCov.

            Creating the Coverage report in CircleCI seems to work:

            But uploading to CodeCov fails, claming report cannot be found:

            I followed the instructions at

            • Used orb codecov/codecov@1.0.2
            • Allowed unprivate orbs
            • Using CircleCI 2.1
            • Generating phpdbg
            • I tried with store_artificats and without, unclear to me if this shall be used with codecov, but both fail

            Thats my config.yml:



            Answered 2022-Jan-13 at 14:24

            Codecov is not able to process HTML coverage reports. You should ask phpunit to output XML as well by either changing or appending your command to read --coverage-clover coverage.xml

            You can view a list of the supported and unsupported coverage formats at

            [1] Saved



            Cypress build error in Azure pipeline: Cannot find module '@cypress/code-coverage/task'
            Asked 2022-Jan-02 at 01:11

            Here is my config:



            Answered 2021-Dec-23 at 14:11

            The problem here might be that Cypress does not support extending the configuration file in the way you did, as also stated here:

            In my opinion there are two suitable solution approaches:

            1. Approach: Use separate configuration files (my recommendation)

            As extending an existing configuration file does not work, I would recommend having separate configuration files, e.g. one for local usage and one for the execution in Azure pipelines. You could then simple add two separate commands in your package.json like:



            Angular test fail to run on Travis with error "Found 1 load error"
            Asked 2021-Nov-22 at 03:56

            Why my travis conf fail to execute Angular test?




            Answered 2021-Nov-22 at 03:56

            I assume that you upgraded your project to Angular 13. I replaced karma-coverage-istanbul-reporter with karma-coverage and it works fine.

            In karma.conf.js, you should replace coverageIstanbulReporter with coverageReporter as follows



            Azure Pipeline "ChromeHeadless have not captured in 60000 ms, killing.", works on second try but sometimes exits with non zero
            Asked 2021-Nov-16 at 03:40

            I am experiencing intermittent build failures with ng test that I think have to do with instances of ChromeHeadless hanging out after failing to properly connect. My Azure pipeline always chirps with one ChromeHeadless have not captured in 60000 ms, killing. (like this question) but then will run the unit tests just fine. The tests will pass about half the time the build goes green. The other half I get a node nonzero exit code error.

            Command: ng test --code-coverage --browsers=ChromeHeadless --watch=false

            Success Log:



            Answered 2021-Nov-16 at 03:40

            I'm noticing that in both cases you are seeing ChromeHeadless have not captured in issue. In the success it took about 1 min 15 sec before it started up. I'm going to make a few assumptions

            • you have quite a bit of code being compiled to run
            • you're using the agent in the pipeline (which I want to say is not overly powerful)

            The good news is that karma has a captureTimeout that defaults to 60,000. I believe if you add this setting to karma.conf and double it you will give time for chrome to handle all of the tests you're making it load.

            You may have a second issue where you possibly have a test that is so intense that chrome sometimes stops responding for longer than browserDisconnectTimeout.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install code-coverage

            Note: this plugin assumes cypress is a peer dependency already installed in your project. Add to your cypress/support/index.js file. Register tasks in your cypress/plugins/index.js file.


            Read the Cypress code coverage guideRead "Code Coverage by Parcel Bundler" blog postRead "Combined End-to-end and Unit Test Coverage"If you are using React, check out @cypress/instrument-craWatch videos in Cypress Tips & Tricks playlist
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone cypress-io/code-coverage

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Code Coverage Tools Libraries


            by coverlet-coverage


            by codecov


            by mozilla


            by codediodeio


            by tntim96

            Try Top Libraries by cypress-io


            by cypress-ioJavaScript


            by cypress-ioTypeScript


            by cypress-ioJavaScript


            by cypress-ioJavaScript