@istanbuljs/nyc-config-babel
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/istanbuljs__nyc-config-babel package

3.0.0 • Public • Published

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

Package Sidebar

Install

npm i @istanbuljs/nyc-config-babel

Weekly Downloads

33,530

Version

3.0.0

License

ISC

Unpacked Size

6.2 kB

Total Files

5

Last publish

Collaborators

  • oss-bot
  • coreyfarrell
  • bcoe
  • jakxz
  • gotwarlost