A gulp plugin that instruments source files with Istanbul code coverage after Babel transpilation, enabling ES2015+ coverage reporting. Version 1.6.0 (latest) uses babel-istanbul under the hood. It integrates with any Node.js test framework via gulp, providing hooks for require and reports. Compared to alternatives like gulp-istanbul, it natively handles Babel-transpiled code. Browser testing is untested. Requires gulp, babel, and Istanbul. Slow release cadence; last update 2016. Consider seamless builds with webpack or karma for browser coverage.
npm install gulp-babel-istanbulVerified import paths — ran on the pinned version, not inferred.
Shows complete gulp task for instrumenting ES2015 source, running mocha tests, and generating coverage reports with threshold enforcement.
Call .pipe(istanbul.hookRequire()) before the finish event.
Use Karma with karma-coverage instead for browser coverage.
Use gulp-babel with @babel/core and @babel/preset-env; this plugin uses babel-istanbul which may not be updated.
Use CommonJS modules or transpile to CJS before testing.
npm install babel-core@^6 --save-dev
Use require('gulp-babel-istanbul').hookRequire or import { hookRequire } from 'gulp-babel-istanbul'Ensure istanbul() and hookRequire() are applied before running tests
Set { includeUntested: true } and ensure hookRequire() is piped