Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"all: true" ignores include flag #782

Closed
jwalton opened this issue Feb 20, 2018 · 5 comments
Closed

"all: true" ignores include flag #782

jwalton opened this issue Feb 20, 2018 · 5 comments

Comments

@jwalton
Copy link

jwalton commented Feb 20, 2018

Expected Behavior

With this config file:

{
    "require": ["babel-register"],
    "reporter": ["lcov", "text-summary"],
    "extension": [".jsx", "*.js"],
    "include": ["src/**"],
    "all": true,
    "sourceMap": false,
    "instrument": false
}

I would expect only files in the 'src' folder to be instrumented.

Observed Behavior

In my project, I see nyc run out of memory because it tries to instrument everything. If I add a console.log() to this line I see that webpack built files in /dist are being instrumented.

Forensic Information

Operating System: OS/X
Environment Information:
node: 8.9.4
nyc: 11.4.1
output: https://gist.github.com/jwalton/193c1fcd02ad861d8805047e193b93f0

@JSteitz
Copy link

JSteitz commented Mar 6, 2018

Have the same problem

As a workaround you can do the following:

1. Exclude all directories except source

{
    "all": true,
    "exclude": [
        "test",
        "build",
        "coverage",
        "dist",
        etc..
    ]
}

2. Change the root path (Currently I'm using this method)

{
    "all": true,
    "cwd": "./source"
}

@bcoe
Copy link
Member

bcoe commented Apr 7, 2018

@jwalton @JSteitz this definitely feels like a bug to me. Will happily accept a patch if either of you have a chance to dig into the issue before me.

@peterjgrainger
Copy link

I'm happy to pick this up.

Would the change be here: https://github.com/istanbuljs/nyc/blob/master/index.js#L179

The change would be to use the includes list if defined. If it isn't then use this.cmd?

@coreyfarrell
Copy link
Member

I believe this will be fixed by #914?

@stale
Copy link

stale bot commented Jan 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 5, 2019
@JaKXz JaKXz closed this as completed in 40afc5f Jan 5, 2019
@JaKXz JaKXz removed the wontfix label Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants