A Babel 6.x plugin that instruments JavaScript code with Istanbul-compatible `__coverage__` variables for test coverage collection. v1.0.0 is the latest stable release. This fork of babel-plugin-__coverage__ adds istanbul-style ignore hints and alters statement counting for conditionals. It works with Karma and mocha/nyc without additional tooling. No ongoing development; exists as a legacy solution for projects stuck on Babel 6.
npm install babel-plugin-coverageVerified import paths — ran on the pinned version, not inferred.
Shows basic setup in .babelrc to enable coverage only during test environments.
Use @babel/plugin-istanbul for Babel 7+.
In package.json, set "nyc": { "include": [ "/" ] } or equivalent.Use karma-coverage or nyc to generate HTML/lcov reports.
Consider migrating to @babel/plugin-istanbul for newer Babel versions and istanbul compatibility.
npm install --save-dev babel-preset-env and add "presets": ["env"] to .babelrc
Use @babel/plugin-istanbul or downgrade to Babel 6.
Use Node.js >= 4.0 and <= 10.x (verify package.json engines if present).