gulp-istanbul is a Gulp plugin that integrates Istanbul, a JavaScript code coverage tool, into a Gulp build workflow. It enables developers to instrument their source code, execute unit tests, and generate detailed coverage reports, with the option to enforce coverage thresholds. The package is currently at version 1.1.3, with its last release in mid-2017. Due to its age and the evolution of both Gulp (which has moved to Gulp 4 and beyond) and code coverage tools (with `nyc` becoming the successor to standalone Istanbul), this package is primarily in maintenance mode and is not actively developed. Its core functionality offers straightforward integration for existing Gulp 3/4 projects and includes support for sourcemaps during code instrumentation.
npm install gulp-istanbulVerified import paths — ran on the pinned version, not inferred.
This quickstart defines Gulp tasks to instrument source code, run Mocha tests, generate Istanbul coverage reports, and enforce a minimum 90% global code coverage threshold.
Downgrade `gulp-mocha` to a compatible version, such as 3.0.1, if you must use `gulp-istanbul`. Consider migrating to `nyc` for modern coverage workflows.
For new projects or projects requiring modern JavaScript support and active maintenance, consider migrating to `nyc` (the current Istanbul command-line client) directly or using integrated solutions in test runners like Jest.
If targeting browser environments, leverage test runners designed for browsers (e.g., Karma) that provide seamless integration with Istanbul for coverage reporting.
Set the `includeUntested` option to `true` when calling `istanbul()` to ensure all files are included in the coverage report, regardless of whether they were executed by tests.
Pass an ES6-compatible instrumenter, such as `isparta.Instrumenter`, to the `istanbul()` plugin options: `.pipe(istanbul({ instrumenter: require('isparta').Instrumenter }))`. Ensure `isparta` is installed.Either increase your test coverage to meet the specified thresholds or adjust the `thresholds` option in `istanbul.enforceThresholds` to acceptable levels. Ensure all relevant files are being instrumented and tested.