Registry / testing / rollup-plugin-coverage

rollup-plugin-coverage

JSON →
library0.1.4jsnpmunverified

Rollup plugin for Istanbul unit test coverage. Version 0.1.4 provides integration with Istanbul instrumenter for code coverage reporting in Rollup and Karma. It offers options for include/exclude patterns, coverage options, and sourcemap support. The plugin is no longer actively maintained; users are advised to migrate to @rollup/plugin-istanbul or official Rollup coverage plugins.

npm install rollup-plugin-coverage
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-COVE
R
rollup-plugin-coverage
testingjavascriptv0.1.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import coverage from 'rollup-plugin-coverage'
const coverage = require('rollup-plugin-coverage')
ESM default import; CJS require works but is not idiomatic for Rollup configs
coverage
import coverage from 'rollup-plugin-coverage'
import { coverage } from 'rollup-plugin-coverage'
Package exports a default export only, not named.
coverage
const coverage = require('rollup-plugin-coverage').default
const coverage = require('rollup-plugin-coverage')
CommonJS requires .default access due to ESM default export

Configures Rollup with Istanbul coverage, excluding test files and setting ES module instrumentation.

import { rollup } from 'rollup'; import coverage from 'rollup-plugin-coverage'; rollup({ input: 'src/main.js', plugins: [ coverage({ exclude: ['test/**/*.js', 'node_modules/**'], coverageOptions: { esModules: true } }) ] }).then(bundle => bundle.write({ file: 'dist/bundle.js', format: 'es' }));
Debug
Known issues
deprecatedPackage has not been updated since 2018 and is effectively deprecated. Use @rollup/plugin-istanbul instead.
fix
Replace with @rollup/plugin-istanbul: npm install @rollup/plugin-istanbul and update import.
affects: >=0.0.0
gotchaPlugin must be placed before other plugins (like babel) to avoid instrumentation issues.
fix
Place coverage plugin first in the plugins array.
affects: >=0.0.0
gotchaCoverage variable is not automatically captured in browser testing; requires manual extraction.
fix
Use Karma with karma-coverage for automatic browser coverage collection.
affects: >=0.0.0
gotchaSourcemap support requires setting sourceMapWithCode: true in coverageOptions.
fix
Add coverageOptions: { sourceMapWithCode: true }.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-coverage'
Package not installed or missing from node_modules.
fix
Run npm install rollup-plugin-coverage --save-dev
TypeError: coverage is not a function
Using named import instead of default import.
fix
Change import { coverage } to import coverage
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies
rolluprequiredPeer dependency for Rollup bundler API
istanbulrequiredCoverage engine used internally
Agent activity
19 hits · last 30 days
node
16
Amazon
2
Resources
rollup-plugin-coverage — npm install rollup-plugin-coverage · libregistry