billowy-pharmacist-61146
01/31/2023, 10:02 AM*.cy.ts with @cypress/code-coverage and Istanbul.
The problem is that I can't exclude the *.cy.ts files from coverage report.
Here is my configuration :
package.json :
"devDependencies": {
...
"@cypress/code-coverage": "3.10.0",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"cypress": "12.4.1",
"vite-plugin-istanbul": "4.0.0",
...
},
cypress.config.ts :
import { defineConfig } from 'cypress'
import registerCodeCoverageTasks from '@cypress/code-coverage/task'
export default defineConfig({
env: {
codeCoverage: {
exclude: ['cypress/**/*.*', 'src/**/*.cy.ts'],
},
},
component: {
devServer: {
framework: 'vue',
bundler: 'vite',
},
setupNodeEvents(on, config) {
registerCodeCoverageTasks(on, config)
return config
},
},
})
.nycrc.json :
{
"all": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": true,
"include": [
"src/**/*.ts",
"src/**/*.vue"
],
"exclude": [
"src/**/*.cy.ts",
"cypress/**/*.*",
"**/*.d.ts",
"**/*.cy.ts"
],
"report-dir": "./coverage-cypress"
}
Anything I'm missing ?
Thanks for your help !billowy-pharmacist-61146
02/01/2023, 8:42 AM