Giter Site home page Giter Site logo

Comments (11)

rupert-ong avatar rupert-ong commented on June 11, 2024 3

Hi @bahmutov. I created a repo with a reproducible example at https://github.com/rupert-ong/instrument-cra-bug.

from instrument-cra.

clazette avatar clazette commented on June 11, 2024 2

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.

nielsboecker-zuhlke avatar nielsboecker-zuhlke commented on June 11, 2024

Same here, include and exclude seem to be ignored from the report initially generated.

from instrument-cra.

rupert-ong avatar rupert-ong commented on June 11, 2024

Confirming that include and exclude does not work on my end either.

from instrument-cra.

amymb avatar amymb commented on June 11, 2024

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.

bahmutov avatar bahmutov commented on June 11, 2024

Can I please see a public repo with a reproducible example?

from instrument-cra.

EH-SrdjanDjakovic avatar EH-SrdjanDjakovic commented on June 11, 2024

Just try extending your package.json by adding extra line "excludeAfterRemap": true in nyc like this:

"nyc": {
   "exclude": [...],
   "excludeAfterRemap": true
}

from instrument-cra.

schadha08 avatar schadha08 commented on June 11, 2024

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.

davidbejarcaceres avatar davidbejarcaceres commented on June 11, 2024

I´m having the same problem, even with the example project just add the exclude but it´s not working:
image

But the index.js still showing in coverage list fo files from the Chrome Browser:
image

The final coverage report still has the index.js, there´s no way to exclude files:
image

I have tried these but are not working:

  1. .nycrc.json (exclude not working)
  2. .babelrc (exclude not working)

Has anyone tried to do it? maybe an older version without this bug?

from instrument-cra.

ibrahimsTailorMed avatar ibrahimsTailorMed commented on June 11, 2024

I'm still having this issue following all the suggested solutions above, any workaround please ?

from instrument-cra.

SaharMehrjouSopraSteria avatar SaharMehrjouSopraSteria commented on June 11, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.