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

Can't run "babel-node" from package.json script #35

Closed imposibrus closed 8 years ago

imposibrus commented 8 years ago

// "i-dont-speak-english" mode on

https://babeljs.io/blog/2015/10/31/setting-up-babel-6/

The babel package is no more. Now we’ve split it up into two separate packages: babel-cli and babel-core.

Right now babel package has bin file babel-node with deprecation warning (and just process.exit();). Therefore i can't use following code in package.json:

...
"scripts": {
    "coverage": "babel-node node_modules/.bin/babel-istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot"
}
...

Also i can't use absolute path to globally installed babel-node (different environments, etc.). Temporary workaround is install babel-cli locally. But i think that replace dependency babel on babel-core it's necessary.

// "i-dont-speak-english" mode off

jeffrifwald commented 8 years ago

You'll have to install and use babel-cli in your project. That has been working well for me. They simply moved the babel-node bin to a new repository. This project never explicitly tells you to use babel-node, it is for you to decide how you want to run your tests.