cypress-io / cypress-io/code-coverage

[cy10] non "cra" react app: "glob pattern string required (current version of @cypress/code-coverage is not supported)"

Open
#580 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
445
Forks
115
PR merge metrics
No merged PRs in 30d

Description

Dear Cypress Devs,

first congratulations to the release of version 10. Looks good :rocket:
However, unfortunately the code-coverage plugin is no longer working for us.
See error message below

**Logs and screenshots**
"Cypress detected that the current version of @cypress/code-coverage is not supported. Update it to the latest version"

**Versions**

plugin: > 3.10.0 (tried `npm i https://github.com/cypress-io/code-coverage` as well)
cypress: > 9.7.0
Operating System: Pop!_OS 20.10 x86_64
Shell: zsh 5.8
Node: v16.13.2
NPM: 8.5.5
react": "^16.14.0"

Instrument the code using:
"babel-plugin-istanbul": "^6.0.0",

`Object.keys(window.__coverage__).length` => 51

Is there `.nyc_output` folder? => NO

custom nyc settings:
```json
"nyc": {
"report-dir": "cypress/coverage",
"reporter": [
"cobertura",
"json-summary",
"json",
"lcov"
]
},
```

Do you run Cypress tests in a Docker container? => NO

**Describe the bug**
I try to run a any test using the newest code-coverage plugin (3.10.0) with the newest cypress version (10.1.0)
but it errors out on the test runner and from the command line with the same error:
"Cypress detected that the current version of @cypress/code-coverage is not supported. Update it to the latest version"

Done test:
```javascript
describe("Test", () => {
it("test login", () => {
cy.visit(Cypress.config("baseUrl"));
cy.screenshot()
});
});
```

Below you find my configs:
```javascript
e2e: {
setupNodeEvents(on, config) {
return require('./plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:4000',
experimentalSessionAndOrigin: true,
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
```

```javascript
///
const webpack = require("@cypress/webpack-preprocessor");

/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {

// does not matter if used webpack or not in both cases the same error
// const options = {
// webpackOptions: require("../../webpack.testing.js"),
// watchOptions: {},
// };
// on("file:preprocessor", webpack(options));

require("@cypress/code-coverage/task")(on, config);
return config;
};
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.