nyc: 7.0.0-alpha4 + babel-plugin-istanbul breaks transpilation for test runner

Minimal reproduction: https://gist.github.com/JaKXz/9c9aa2c9dcc106e59939ec4b9f79c4f4

continued from: https://github.com/istanbuljs/nyc/issues/288#issuecomment-230127167

$ npm t

> nyc-ava-test@1.0.0 test /Users/Jason/Downloads/e91baeead7f4ff2df6825abf33327479-987c9806f48df16c90abf1c069044f2437551bbf
> cross-env NODE_ENV=test nyc -r lcov ava


   2 failed


   1. should default to hello world
   failed with "Cannot read property '0' of undefined"
      say (say.js:1:6143)
    Test.fn (test.js:5:8)
    processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:146:32)
    processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:146:32)
    _combinedTickCallback (internal/process/next_tick.js:67:7)
    process._tickCallback (internal/process/next_tick.js:98:9)


   2. should say a custom greeting to hello world
   failed with "Cannot read property '0' of undefined"
      say (say.js:1:6143)
    Test.fn (test.js:9:8)
    processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:146:32)
    processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:146:32)
    _combinedTickCallback (internal/process/next_tick.js:67:7)
    process._tickCallback (internal/process/next_tick.js:98:9)
File [/Users/Jason/Downloads/e91baeead7f4ff2df6825abf33327479-987c9806f48df16c90abf1c069044f2437551bbf/say.js] ignored, nothing could be mapped
npm ERR! Test failed.  See above for more details.

I am not fully sure which project to “blame”, so I can move this to the babel-plugin-istanbul repo if that’s better. @bcoe @gotwarlost cc @kentcdodds if you see this in your test as well.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@hoschi, @gotwarlost, retracing my steps, I was considering turning the cache on by default in 7.x, it seems like keeping cache as an option that folks need to knowingly enable is the right call however.

I had the same problem as @gotwarlost where even source trees from backup failed, which worked 3 days before, when setting up AVA together with nyc. Problem here is really babel has its own cache, ava maintains a cache and sometimes you need a ‘disable all the performance and show me whats failing’ flag.