Registry / testing / jest-watch-typeahead

jest-watch-typeahead

JSON →
library3.0.1jsnpmunverified

jest-watch-typeahead is a Jest plugin designed to enhance the developer experience by providing interactive, real-time filtering of test files and test names directly within Jest's watch mode. It allows users to quickly narrow down the tests being run by typing part of a filename or test description, significantly improving efficiency in large test suites. The current stable version is 3.0.1, released on 2025-06-19. New major versions typically align with Jest's own major releases (e.g., v3.0.0 for Jest 30) to ensure compatibility, leading to a release cadence that closely tracks Jest's evolution. This plugin differentiates itself by seamlessly integrating type-ahead search capabilities into the Jest watch interface, offering a more dynamic and intuitive alternative to manual test path specification or static regex filtering. It focuses purely on improving test navigation and execution flow during active development, providing a significant quality-of-life improvement for developers working with extensive test bases.

npm install jest-watch-typeahead
INSTALL
IMPORT
SIG · JEST-WATCH-TYPEAHE
J
jest-watch-typeahead
testingjavascriptv3.0.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

Filename Watch Plugin
✓ module.exports = { watchPlugins: ['jest-watch-typeahead/filename'] };
✗ import { filename } from 'jest-watch-typeahead';
This plugin is configured in your Jest configuration file (e.g., `jest.config.js` or `package.json`), not imported as a JavaScript module.
Test Name Watch Plugin
✓ module.exports = { watchPlugins: ['jest-watch-typeahead/testname'] };
✗ import { testname } from 'jest-watch-typeahead';
Similar to the filename plugin, this is a path string configured directly within Jest's `watchPlugins` array.
Configuring Plugin with Options
✓ module.exports = { watchPlugins: [ ['jest-watch-typeahead/filename', { key: 'k', prompt: 'Filter by filename:' }] ] };
✗ module.exports = { watchPlugins: [ 'jest-watch-typeahead/filename', { key: 'k', prompt: 'Filter by filename:' } ] };
When passing options to a watch plugin, the plugin path string and its options object must be nested together in an inner array within the `watchPlugins` array.

Demonstrates how to install `jest-watch-typeahead` and configure it in `package.json` for interactive test filtering in Jest's watch mode, including how to pass options.

{ "name": "my-jest-project", "version": "1.0.0", "devDependencies": { "jest": "^30.0.0", "jest-watch-typeahead": "^3.0.0" }, "scripts": { "test:watch": "jest --watch" }, "jest": { "watchPlugins": [ "jest-watch-typeahead/filename", "jest-watch-typeahead/testname" ] } } // Then, run from your terminal: // npm install // npm run test:watch // For a jest.config.js example: // jest.config.js // module.exports = { // watchPlugins: [ // 'jest-watch-typeahead/filename', // ['jest-watch-typeahead/testname', { key: 't', prompt: 'Filter by test name:' }] // ] // };
Debug
Known issues
breakingVersion 3.0.0 of `jest-watch-typeahead` drops support for Jest 27, 28, and 29. It also drops support for Node.js versions 14, 16, 19, 21, and 23.
fix
Upgrade Jest to version 30 or higher and Node.js to version 18 or higher to use `jest-watch-typeahead@3.x.x`. If you need to support older Jest or Node.js versions, you must use `jest-watch-typeahead@2.x.x`.
affects: >=3.0.0
breakingVersion 2.0.0 of `jest-watch-typeahead` dropped support for Node.js versions 12 and 17.
fix
Ensure your Node.js environment is at least version 14.x or 16.x when using `jest-watch-typeahead@2.x.x`. For `3.x.x`, Node.js 18 or higher is required.
affects: >=2.0.0 <3.0.0
gotchaIncorrectly configuring watch plugins with options can lead to unexpected behavior or errors in Jest's watch mode.
fix
When providing options to a watch plugin, ensure the plugin string and its options object are wrapped together in an *inner* array. For example: `['jest-watch-typeahead/filename', { key: 'f' }]`.
affects: >=1.0.0
gotcha`jest-watch-typeahead` requires a compatible version of Jest as a peer dependency. Installing an incompatible Jest version will likely result in runtime errors or the plugin not activating.
fix
Always check the `peerDependencies` in the `package.json` of `jest-watch-typeahead` to ensure your installed Jest version matches the required range. For `v3.x.x`, Jest `^30.0.0` is required.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Plugin 'jest-watch-typeahead/filename' is not a valid Jest watch plugin
The `jest-watch-typeahead` package is either not installed, or the path in the Jest configuration is misspelled or incorrect.
fix
Ensure `jest-watch-typeahead` is installed as a dev dependency (`npm install --save-dev jest-watch-typeahead`) and verify the plugin paths in your `jest.config.js` or `package.json` are correct: `'jest-watch-typeahead/filename'` and `'jest-watch-typeahead/testname'`.
Jest encountered an unexpected token. This usually means that you are trying to import a file which Jest cannot parse.
This error often indicates an incompatibility between your Node.js version, Jest version, or `jest-watch-typeahead` version, particularly when newer syntax is used in an older environment.
fix
Check the Node.js and Jest version requirements for your installed `jest-watch-typeahead` version. For `v3.x.x`, ensure Node.js >=18 and Jest >=30. Upgrade your environment or downgrade `jest-watch-typeahead` if necessary.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
jestrequiredThis package is a Jest plugin and requires Jest to function. It has a peer dependency on `^30.0.0` for v3.x.
Agent activity
6 hits · last 30 days
node
6
Resources
jest-watch-typeahead — npm install jest-watch-typeahead · libregistry