3.0.0 • Published 4 years ago

@istanbuljs/nyc-config-babel v3.0.0

Weekly downloads
16,437
License
ISC
Repository
github
Last release
4 years ago

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