Skip to content

Coverage summary shows all Unknown% #316

@csymeonides-mf

Description

@csymeonides-mf
=============================== Coverage summary ===============================
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================

Seems similar to #61 but the fix is not working for me.

Logs and screenshots
Full debug logs

Versions

  • What is this plugin's version? Latest (3.8.1) (unfortunately I can't say exactly when this started happening)
  • What is Cypress version? 5.0.0
  • What is your operating system/shell/Node/NPM? This is running in docker with base image cypress/browsers:node12.18.0-chrome83-ff77
  • How do you instrument your application? I use babel-plugin-istanbul. Here is my config-overrides.js I have:
const { addBabelPlugin, addBabelPreset, override, addLessLoader } = require('customize-cra');
const rewireReactHotLoader = require('react-app-rewire-hot-loader-for-customize-cra');

module.exports = override(
    addLessLoader(
        { lessOptions: { javascriptEnabled: true }}
    ),
    rewireReactHotLoader(),
    addBabelPlugin('istanbul'),
    addBabelPreset('@babel/preset-react'),
);
  • When running tests, if you open the web application in regular browser, and open DevTools, do you see window.__coverage__ object? Can you paste a screenshot?
    image
  • Is there .nyc_output folder? Is there .nyc_output/out.json file. Is it empty? Can you paste at least part of it so we can see the keys and file paths?
{
  "/app/src/runtimeConfig.ts": {
    "path": "/app/src/runtimeConfig.ts",
    "statementMap": {
      "0": {
        "start": {
          "line": 1,
          "column": 23
        },
        "end": {
          "line": 1,
          "column": 61
        }
      },
      "1": {
        "start": {
          "line": 4,
          "column": 15
        },
        "end": {
          "line": 4,
          "column": 51
        }
      },
    "nyc": {
        "extends": "@istanbuljs/nyc-config-typescript",
        "all": true
    }
  • Do you run Cypress tests in a Docker container? Yes, as mentioned above

Describe the bug
All entries in the console output of npx nyc report --reporter=text-summary are "Unknown%". The actual report looks fine, but the invalid value in the console output breaks my coverage badge in gitlab.

Link to the repo
No open source repo I'm afraid, but happy to provide additional code snippets if necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions