This release integrates with nyc better by respecting include/exclude options specified in package.json file. This allows easier integrations with nyc which looks less hacky. Unfortunately this means for existing users that uses nyc with babel-plugin-coverage, this release is a breaking change.
Compatibility notes: babel-plugin-__coverage__@^11.0.0 should be used with nyc@^6.6.1
-
In previous versions, instrumentation is disabled by telling
nycto only instrument a bogus path:"nyc": { "include": [ "/" ] }
Then you have to configure
include/excludeoptions in your.babelrcfile. -
In this version, this plugin will respect nyc’s
include/excludeconfiguration, so with the original configuration no files will be instrumented (the breaking change).To fix this, remove the bogus configuration, and use nyc’s
instrumentandsourceMapflags instead."nyc": { "instrument": false, "sourceMap": false }
You can also configure the included/excluded files here instead of in the
.babelrc."nyc": { "instrument": false, "sourceMap": false, "exclude": [ "**/*Spec.js" ] }