nyc-config-babel
Handy default configuration for instrumenting your babel-backed
project with test coverage using nyc and
babel-plugin-istanbul.
First install the dependencies:
npm i babel-plugin-istanbul @istanbuljs/nyc-config-babel --save-dev
Then write a .babelrc
that looks something like this:
.babelrc
{
"presets": ["@babel/env", "..., etc."],
"plugins": ["istanbul"]
}
.nycrc
And write a .nycrc
that looks something like this:
{
"extends": "@istanbuljs/nyc-config-babel"
}
Running Tests
Now setup the test scripts in your package.json like so:
{
"test": "nyc mocha test.js"
}
License
ISC