File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -565,3 +565,17 @@ Whether to use [worker threads](https://nodejs.org/dist/latest/docs/api/worker_t
565565This is ** experimental feature** . See the [ ` workerThreads ` configuration option] ( Configuration.md#workerthreads ) for more details.
566566
567567:::
568+
569+ ## Watch Mode Tips
570+
571+ When using Jest in watch mode (` --watch ` or ` --watchAll ` ), here are some best practices to maximize productivity:
572+
573+ - ** Use ` --testNamePattern ` (` -t ` )** in combination with ` --watch ` to focus on specific tests while developing.
574+ - ** Press ` o ` in watch mode** to only run tests related to changed files instead of all tests.
575+ - ** Press ` f ` in watch mode** to run only the tests that failed in the previous run.
576+ - ** Press ` p ` in watch mode** to filter tests by filename pattern interactively.
577+ - ** Set ` --maxWorkers ` ** if watch mode is consuming too much memory or CPU on your machine.
578+ - ** Use ` --bail ` ** (` -x ` ) to stop after the first test failure, useful for TDD workflows.
579+ - ** Clear cache** with ` jest --clearCache ` if you encounter stale cache issues during long watch sessions.
580+
581+ For more details, see the [ Configuration] ( Configuration.md ) page and run ` jest --help ` for all available options.
You can’t perform that action at this time.
0 commit comments