jeffrifwald / babel-istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
144 stars 23 forks source link

`--print none` not being caught? #41

Closed orbiteleven closed 8 years ago

orbiteleven commented 8 years ago

Running the following on a babel+es6+jsx+tape test:

babel-node node_modules/.bin/babel-istanbul cover --print none --report cobertura --report text --report html --report json-summary node_modules/.bin/tape -- test/index.js

Which should tell the reporting to be silent, but I get:

/Users/damon/Projects/web-promotions/node_modules/babel-cli/lib/_babel-node.js:102
  return _vm2["default"].runInThisContext(code, {
                         ^
ReferenceError: none is not defined
    at [object Object]:3:1
    at _eval (/Users/damon/Projects/web-promotions/node_modules/babel-cli/lib/_babel-node.js:102:26)
    at Object.<anonymous> (/Users/damon/Projects/web-promotions/node_modules/babel-cli/lib/_babel-node.js:122:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

Am I missing something, or should this be picked up by babel-istanbul?

jeffrifwald commented 8 years ago

The print option is for Babel, right? Maybe try:

babel-node --print none node_modules/.bin/babel-istanbul cover --report cobertura --report text --report html --report json-summary node_modules/.bin/tape -- test/index.js
orbiteleven commented 8 years ago

it's for istanbul. It's even listed on babel-istanbul help cover.

jeffrifwald commented 8 years ago

Ah ok, the issue is due to babel-node having a print argument also. Try this:

babel-node -- node_modules/.bin/babel-istanbul cover --print none --report cobertura --report text --report html --report json-summary node_modules/.bin/tape -- test/index.js
orbiteleven commented 8 years ago

D'oh... that was totally it. Thanks!