{"id":13386,"library":"jest-watch-typeahead","title":"Jest Watch Typeahead","description":"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.","status":"active","version":"3.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/jest-community/jest-watch-typeahead","tags":["javascript"],"install":[{"cmd":"npm install jest-watch-typeahead","lang":"bash","label":"npm"},{"cmd":"yarn add jest-watch-typeahead","lang":"bash","label":"yarn"},{"cmd":"pnpm add jest-watch-typeahead","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a Jest plugin and requires Jest to function. It has a peer dependency on `^30.0.0` for v3.x.","package":"jest","optional":false}],"imports":[{"note":"This plugin is configured in your Jest configuration file (e.g., `jest.config.js` or `package.json`), not imported as a JavaScript module.","wrong":"import { filename } from 'jest-watch-typeahead';","symbol":"Filename Watch Plugin","correct":"module.exports = {\n  watchPlugins: ['jest-watch-typeahead/filename']\n};"},{"note":"Similar to the filename plugin, this is a path string configured directly within Jest's `watchPlugins` array.","wrong":"import { testname } from 'jest-watch-typeahead';","symbol":"Test Name Watch Plugin","correct":"module.exports = {\n  watchPlugins: ['jest-watch-typeahead/testname']\n};"},{"note":"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.","wrong":"module.exports = {\n  watchPlugins: [\n    'jest-watch-typeahead/filename', { key: 'k', prompt: 'Filter by filename:' }\n  ]\n};","symbol":"Configuring Plugin with Options","correct":"module.exports = {\n  watchPlugins: [\n    ['jest-watch-typeahead/filename', { key: 'k', prompt: 'Filter by filename:' }]\n  ]\n};"}],"quickstart":{"code":"{\n  \"name\": \"my-jest-project\",\n  \"version\": \"1.0.0\",\n  \"devDependencies\": {\n    \"jest\": \"^30.0.0\",\n    \"jest-watch-typeahead\": \"^3.0.0\"\n  },\n  \"scripts\": {\n    \"test:watch\": \"jest --watch\"\n  },\n  \"jest\": {\n    \"watchPlugins\": [\n      \"jest-watch-typeahead/filename\",\n      \"jest-watch-typeahead/testname\"\n    ]\n  }\n}\n\n// Then, run from your terminal:\n// npm install\n// npm run test:watch\n\n// For a jest.config.js example:\n// jest.config.js\n// module.exports = {\n//   watchPlugins: [\n//     'jest-watch-typeahead/filename',\n//     ['jest-watch-typeahead/testname', { key: 't', prompt: 'Filter by test name:' }]\n//   ]\n// };","lang":"typescript","description":"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."},"warnings":[{"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`.","message":"Version 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.","severity":"breaking","affected_versions":">=3.0.0"},{"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.","message":"Version 2.0.0 of `jest-watch-typeahead` dropped support for Node.js versions 12 and 17.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"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' }]`.","message":"Incorrectly configuring watch plugins with options can lead to unexpected behavior or errors in Jest's watch mode.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"`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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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'`.","cause":"The `jest-watch-typeahead` package is either not installed, or the path in the Jest configuration is misspelled or incorrect.","error":"Error: Plugin 'jest-watch-typeahead/filename' is not a valid Jest watch plugin"},{"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.","cause":"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.","error":"Jest encountered an unexpected token. This usually means that you are trying to import a file which Jest cannot parse."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}