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

Can't exclude file in directory #296

Closed
hoschi opened this issue Jul 5, 2016 · 4 comments
Closed

Can't exclude file in directory #296

hoschi opened this issue Jul 5, 2016 · 4 comments
Milestone

Comments

@hoschi
Copy link

hoschi commented Jul 5, 2016

I have a file in src/userAuth/userAuthReducer.js which I can't exlude with its parent dir in the pattern.

this works

  • **/userAuthReducer.js

this doesn't

  • **/userAuth/userAuthReducer.js
  • */userAuth/userAuthReducer.js
  • src/userAuth/userAuthReducer.js

nyc version: 6.6.1
node version: 6.2.1
I use babel-plugin-__coverage__ for instrumenting

@bcoe bcoe added this to the nyc-7 milestone Jul 6, 2016
@bcoe
Copy link
Member

bcoe commented Jul 6, 2016

@hoschi this works fine for me:

  "nyc": {
    "include": [
      "src/**/*.js"
    ],
    "exclude": [
      "src/foo/snuh.js"
    ],
    "require": [
      "babel-core/register"
    ],
    "sourceMap": false,
    "instrument": false
  },

I was having a bit of trouble but the underlying issue turned out to be the babel cache interfering with instrumentation, so I ran tests using:

BABEL_DISABLE_CACHE=1 npm t

try this and I think you'll find it does the trick.

@jamestalmage
Copy link
Member

jamestalmage commented Jul 6, 2016

nyc should probably just disable the cache automatically

@skeep
Copy link

skeep commented Jul 11, 2016

BABEL_DISABLE_CACHE=1 npm t works for me too. Looks like it's getting fixed in #303

@hoschi
Copy link
Author

hoschi commented Jul 13, 2016

After upgrading nyc to 7.0.0 and switching to babel-plugin-istanbul this works now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants