jest-watch-typeahead

Jest watch-mode plugins that let you filter running tests by file name or test name through an interactive typeahead prompt.

Tool
npm
v3.0.1
412stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
51/100Fair
Development Activity48
Maintenance32
Community44
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
61/100Good
Architecture78
Code Quality72
Innovation68
Learning Curve25

jest-watch-typeahead adds two watch plugins to Jest’s interactive watch mode: one that filters test files by a filename regex pattern, and one that filters by individual test name. Instead of re-running an entire suite, a developer presses a key to open a live prompt, types a partial pattern, and sees a highlighted, scrollable list of matching files or tests update as they type — then commits the pattern to instantly re-scope watch mode to just those matches.

The package ships as a pair of independently importable subpath exports (jest-watch-typeahead/filename and jest-watch-typeahead/testname) with zero required configuration, sensible default key bindings, and small per-plugin overrides for the activation key and prompt text. It is maintained under the jest-community GitHub organization and is one of the most widely used companion packages in the Jest ecosystem, downloaded millions of times a week.

What You Get

  • Two Jest watch plugins — a filename filter and a test-name filter — exported as separate subpaths from one package.
  • An interactive terminal prompt with live typeahead search, match-count feedback, and highlighted matching substrings.
  • Zero-config defaults (key p for the filename plugin, t for the test-name plugin) with optional per-plugin key/prompt overrides.
  • Automatic tracking of the active Jest projects on file changes so filtering stays scoped correctly in multi-project configs.

Common Use Cases

  • Narrowing Jest’s watch mode to one file or a small group of files in a large monorepo test suite.
  • Filtering down to a single failing it()/describe() block by test name instead of re-running the whole suite.
  • Switching between filename and test-name filtering while iterating locally on a pull request.
  • Exploring an unfamiliar codebase’s test coverage by typing partial names to see what tests exist.

Under The Hood

Architecture The package is a thin, focused implementation of Jest’s WatchPlugin interface, split into two parallel plugin classes (file_name_plugin/plugin.ts, test_name_plugin/plugin.ts) that each wire a Prompt instance from jest-watcher to a plugin-specific *PatternPrompt class in prompt.ts; shared formatting and matching logic lives in lib/pattern_mode_helpers.ts, lib/utils.ts, and lib/scroll.ts. Data flows from Jest’s onFileChange hook (captured active projects) through keystroke events (onKeyprompt.put()) into the prompt’s render loop, and back out via updateConfigAndRun with a computed testPathPatterns or testNamePattern. Because both plugins implement jest-watcher’s interface directly with minimal abstraction between them, a change to that upstream contract would require updating both plugin classes in lockstep.

Tech Stack Written in TypeScript (ESNext target, type: module, strict mode) and compiled with Babel (babel --extensions .js,.ts src -d build). Runtime dependencies are small, single-purpose terminal utilities — chalk, strip-ansi, ansi-escapes, string-length, slash — plus jest-watcher and jest-regex-util from the Jest monorepo, with jest itself as a peer dependency. Tooling includes ESLint 9’s flat config with typescript-eslint and eslint-plugin-jest, Prettier, Yarn 4 (Berry) as the package manager, and semantic-release for automated versioned publishing. CI runs the test matrix across Node 18, 20, 22, and 24 via GitHub Actions, alongside a separate commitlint job.

Code Quality Tests are colocated under __tests__ directories next to the source they cover, use @jest/globals explicit imports (injectGlobals: false), parameterized test.each cases, and snapshot assertions (jest-serializer-ansi-escapes for ANSI-safe snapshots). TypeScript strict mode plus noImplicitReturns and consistent file casing are enforced at the compiler level, and ESLint/Prettier are wired into CI. Coverage leans toward the pure formatting/matching helpers (utils.ts, pattern_mode_helpers.ts) and plugin construction; the interactive prompt’s terminal render loop itself has comparatively thinner direct test coverage.

API Design The public surface is deliberately tiny: two subpath exports that slot directly into Jest’s watchPlugins array with no required configuration, sane default key bindings, and an optional { key, prompt } override per plugin. Importing the package’s root entrypoint (rather than a subpath) throws a descriptive error pointing to the correct usage instead of failing silently or behaving unexpectedly — a small but deliberate developer-experience choice. The design isn’t conceptually novel — it’s a clean, well-scoped implementation of Jest’s own documented watch-plugin API — but it requires essentially no boilerplate to adopt.

Used by 9 apps in this directory

TypeScript
68%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,825

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript68%
Java21%
Updated 3 days ago
Ruby
63%
AGPL 3.0

Forem

Community · Blogging

22,775

Open source Ruby on Rails platform for building developer communities with articles, discussions, and social profiles—the same software that powers dev.to.

View details
83
Repo Health
79
Technical
67
Dependency
Built with
Ruby63%
JavaScript19%
HTML13%
Updated 2 days ago
TypeScript
49%
AGPL 3.0

Grafana

Monitoring · Analytics

76,643

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript49%
Go45%
Updated today
TypeScript
94%
AGPL 3.0

Laudspeaker

Marketing · Automation

2,620

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
51
Repo Health
66
Technical
62
Dependency
Built with
TypeScript94%
Updated 1 months ago
JavaScript
44%
Other

LimeSurvey

Forms Surveys

3,711

The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.

View details
85
Repo Health
62
Technical
62
Dependency
Built with
JavaScript44%
PHP34%
CSS12%
Updated 2 days ago
TypeScript
51%
Other

Mattermost

Team Chat · Collaboration · Devops

38,999

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript51%
Go40%
Updated today
Clojure
55%
Other

Metabase

Analytics

49,109

The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.

View details
95
Repo Health
84
Technical
65
Dependency
Built with
Clojure55%
TypeScript40%
Updated today
TypeScript
88%
MIT

Plasmic

CMS · Low Code Platforms · No Code Platforms

6,993

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript88%
Updated yesterday
TypeScript
88%
Other

strapi

CMS

73,083

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
66
Dependency
Built with
TypeScript88%
JavaScript12%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search