jest-slow-test-highlighter
raw JSON → 1.0.2 verified Sat Apr 25 auth: no javascript
A custom Jest reporter that identifies and reports on the slowest running tests in your test suite. Current stable version is 1.0.2. Release cadence is low, single maintainer. Key differentiator: simple configuration with maxTests and slowSeconds options, integrates seamlessly as a Jest reporter. No major updates since initial release.
Common errors
error TypeError: reporters[1] is not a function or string ↓
cause Misconfigured reporters array; reporter is not found or wrong format.
fix
Ensure reporters array uses correct string or tuple format: ['jest-slow-test-highlighter', {...}]
Warnings
gotcha Requires Jest version ^30.1.3; incompatible with older Jest versions. ↓
fix Upgrade Jest to ^30.1.3 or later.
Install
npm install jest-slow-test-highlighter yarn add jest-slow-test-highlighter pnpm add jest-slow-test-highlighter Imports
- jest-slow-test-highlighter wrong
Using require() in test file: const reporter = require('jest-slow-test-highlighter')correctAdded to jest config: reporters: ['default', 'jest-slow-test-highlighter']
Quickstart
npm install jest-slow-test-highlighter --save-dev
// jest.config.js
module.exports = {
reporters: [
'default',
['jest-slow-test-highlighter', { maxTests: 5, slowSeconds: 2 }]
]
};