Jest Watcher

30.3.0 · active · verified Tue Apr 21

Jest Watcher is a core sub-package of the Jest testing framework, providing the interactive command-line interface (CLI) for running tests in 'watch' mode. It enables developers to receive instant feedback on code changes by automatically re-running relevant tests, filtering by filename or test name, and focusing on failed tests. The current stable version is 30.3.0. While Jest v30's major release cycle was notably long (three years), the project aims for more frequent major releases going forward, with minor and patch versions released regularly. Key differentiators include its tight integration with the broader Jest ecosystem for features like snapshot testing and code coverage, offering a dynamic and responsive development workflow compared to static, manual test execution.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to create and register a basic custom Jest watch plugin using TypeScript, logging a message when its key is pressed.

import type { Config } from 'jest';
import { BaseWatchPlugin } from 'jest-watcher';
import type {
  JestHookSubscriber,
  WatchPlugin,
  UsageInfo,
  GlobalConfig,
  UpdateConfigCallback,
} from 'jest-watcher';

// A minimal custom watch plugin that just logs a message
class MyCustomWatchPlugin extends BaseWatchPlugin implements WatchPlugin {
  is);

view raw JSON →