Comments (11)
Hi @bahmutov. I created a repo with a reproducible example at https://github.com/rupert-ong/instrument-cra-bug.
from instrument-cra.
Is there a solution for this issue? v1.4.0 still exhibits this behavior. Exclude is completely ignored. I tried adding the excludeAfterRemap setting but that didn't solve the issue.
from instrument-cra.
Same here, include
and exclude
seem to be ignored from the report initially generated.
from instrument-cra.
Confirming that include
and exclude
does not work on my end either.
from instrument-cra.
Same, have tried configuring in both package.json
and in .nycrc
. In the same vein, providing a list of file extensions to nyc does not work (.ts files are not recognized in the coverage report, even though I have added "extension": [".js", ".ts"]
to my nyc configuration block). I recognize the second item is not a documented part of this library, but it would be a useful addition.
from instrument-cra.
Can I please see a public repo with a reproducible example?
from instrument-cra.
Just try extending your package.json by adding extra line "excludeAfterRemap": true in nyc like this:
"nyc": {
"exclude": [...],
"excludeAfterRemap": true
}
from instrument-cra.
I had the same issue with my CRA and adding "all": true before include and exclude fixed the issue.
"nyc": {
"all": true,
"include": ["src/pages/.js", "src/components///.js", "src/components///*.jsx"],
"exclude": ["src/components/mocks"]
}
from instrument-cra.
I´m having the same problem, even with the example project just add the exclude but it´s not working:
But the index.js still showing in coverage list fo files from the Chrome Browser:
The final coverage report still has the index.js, there´s no way to exclude files:
I have tried these but are not working:
- .nycrc.json (exclude not working)
- .babelrc (exclude not working)
Has anyone tried to do it? maybe an older version without this bug?
from instrument-cra.
I'm still having this issue following all the suggested solutions above, any workaround please ?
from instrument-cra.
@ibrahimsTailorMed
In your cypress.config you can add this it works the only problem is you can't write the path only you can write the names of the files you want to delete.
env: {
codeCoverage: {
exclude: [
"SignIn.js",
"index.js",
],
},
},
@bahmutov is there any update on this issue? I am using cypress V10.9.0.
from instrument-cra.
Related Issues (20)
- In a Gitlab deployment it is not generating build with -r option
- In a Gitlab build deployment, it gives error webpack is configured only for development env even setting CYPRESS_INSTRUMENT_PRODUCTION=true
- Does Not Work with CRA v4 HOT 2
- set up good e2e examples HOT 2
- PUBLIC_URL environment variable not honoured HOT 1
- Problem after add @cypressinstrument-cra on a react app HOT 1
- JS files that aren't loaded by webpack are not included in the coverage report HOT 3
- Leading slash is added when using @cypress/instrument-cra for `react-scripts build` with PUBLIC_URL without leading slash defined HOT 2
- https://github.com/strapi/strapi/pull/9387 HOT 1
- Not able to instrument the files which are outside /app folder HOT 2
- alias paths not working with @cypress/instrument-cra
- React-scripts flag vs customize-cra HOT 3
- Build does not generate relative file paths
- Support react-scripts v5 HOT 8
- Yarn workspace support requires hoisted react-scripts HOT 1
- Not working with pnpm HOT 5
- Is this project dead? HOT 3
- How to use -r @cypress/instrument-cra in scripts start?
- dependency for instrument-cra and how to force instrument in production
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instrument-cra.