Registry / testing / jest-runner-rollup

jest-runner-rollup

JSON →
library1.3.9jsnpmunverified

Jest runner for Rollup, designed to integrate Rollup bundling into Jest test runs. Currently at version 1.3.9 (last released in 2020), it works with Rollup ^1.29.1 and Node >=10.13. It plays well in monorepo scenarios, using Jest's runner API to bundle test files with Rollup before execution. Key differentiators: seamless monorepo support, simple configuration, and leverages Rollup's tree-shaking for faster test runs. However, it is no longer actively maintained and may not work with modern Rollup versions (v2+).

npm install jest-runner-rollup
INSTALL
IMPORT
SIG · JEST-RUNNER-ROLLUP
J
jest-runner-rollup
testingjavascriptv1.3.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default
import jestRunnerRollup from 'jest-runner-rollup'
Default export is the runner function used in Jest config under 'runner' field. No named exports.
createRunner
import { createRunner } from 'jest-runner-rollup'
import createRunner from 'jest-runner-rollup'
createRunner is a named export if package exposes it; but docs show only default. Verify package exports.
Runner
const Runner = require('jest-runner-rollup')
import { Runner } from 'jest-runner-rollup'
CommonJS require returns the default export; there is no named Runner export. Use default import for ESM.

Configures Jest to use jest-runner-rollup as the default test runner, enabling Rollup bundling for each test file.

// jest.config.js module.exports = { runner: 'jest-runner-rollup', testEnvironment: 'node', testMatch: ['**/__tests__/**/*.test.js'], // Optional Rollup config passed to runner: // rollupConfig: { // input: 'src/index.js', // plugins: [/* your rollup plugins */] // } };
Debug
Known issues
deprecatedjest-runner-rollup is no longer actively maintained; last release in 2020. May have compatibility issues with modern Rollup v2+ and Jest versions >=27.
fix
Consider alternatives like @rollup/jest-transform or rollup-jest.
affects: all
gotchaRequires Rollup ^1.29.1 as a peer dependency. Using with Rollup v2+ may cause unexpected errors due to API changes.
fix
Pin Rollup to version ^1.29.1 or use a different Jest runner that supports Rollup v2+.
affects: >=1.0.0
gotchaThe package exposes a default export (a function), not a class. Using `new Runner()` will fail.
fix
Set `runner: 'jest-runner-rollup'` in Jest config (string) rather than trying to import and instantiate.
affects: all
Errors
Common errors & fixes
Cannot find module 'rollup'
Missing peer dependency rollup (required version ^1.29.1).
fix
Install rollup@^1.29.1: npm install rollup@1.29.1 --save-dev
TypeError: runner is not a constructor
Attempted to use `new require('jest-runner-rollup')()` but the package exports a function, not a class.
fix
Set `runner: 'jest-runner-rollup'` in Jest config instead of using `runner: require('jest-runner-rollup')`.
Jest: 'runner' option must be a string, a class, or a function.
Passed an object or other invalid type as runner value.
fix
Use a string like 'jest-runner-rollup' or a valid runner class/function.
Upgrade
Version history
1.3.9latest on npm
Audit
Dependencies
rollupoptionalPeer dependency required to bundle test files; must be version ^1.29.1
Agent activity
4 hits · last 30 days
node
4
Resources
jest-runner-rollup — npm install jest-runner-rollup · libregistry