Code coverage generation #16799
Unanswered
jhiester
asked this question in
Component Testing
Replies: 1 comment
-
I can see code coverage report data for component testing, but I have same code coverage reset issue for component testing after run different components what means if I run A component testing then I can get code coverage information for A component but after I run B component testing, I will lose previous A component code coverage information, here is my configurations: cypress/support/cypress.config.ts component: {
setupNodeEvents(on, config) {
require('@cypress/code-coverage/task')(on, config)
return config
},
devServer: {
framework: 'react',
bundler: 'webpack',
webpackConfig: require(webpackConfigFilePath),
},
specPattern: '**/*.cy.[jt]s(x)?',
supportFile: 'cypress/support/component.tsx'
} cypress/support/component.tsx import '@cypress/code-coverage/support' package.json "nyc": {
"all": true,
"exclude": [
"cypress/**/*.{js,jsx,ts,tsx}"
],
"excludeAfterRemap": false,
"extends": "@istanbuljs/nyc-config-typescript",
"include": [
"src/**/*.{js,jsx,ts,tsx}"
]
}, Version: Cypress v12.8.1 Anyone solved this issue? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to get code coverage for component testing using Cypress similar to how we can get coverage for unit/ingegration/e2e tests?
In my setup right now, cypress resets all of my previously generated code coverage information when component testing. I know I can set it up to not do this, but I was trying to get component level code coverage.
Code coverage has been really useful for development and I think having code coverage at the component level would also be pretty useful for us.
Beta Was this translation helpful? Give feedback.
All reactions