Instrumenter for esnext-coverage.
npm install babel-plugin-transform-esnext-coverage --save-dev
It is recommended that you run the instrumenter conditionally, using env
variables, e.g. NODE_ENV=test
:
{
"env": {
"test": {
"plugins": ["transform-esnext-coverage"]
}
}
}
$ babel --plugins transform-esnext-coverage script.js
require('babel-core').transform('code', {
plugins: ['transform-esnext-coverage']
});