watch
watch sets only watchPlugins. Use it at the root of a multi-project config. Every -watch preset is its base preset
plus these same plugins.
export default { preset: '@repobuddy/jest/presets/watch', projects: ['<rootDir>/packages/*'],}Options
Section titled “Options”None. A preset takes no options. To pick other plugins, use
fields.defineWatchPlugins().
Effective config
Section titled “Effective config”{ watchPlugins: [ 'jest-watch-suspend', ['jest-watch-toggle-config', { setting: 'collectCoverage' }], ['jest-watch-toggle-config', { setting: 'verbose' }], 'jest-watch-typeahead/filename', 'jest-watch-typeahead/testname', ],}This is fields.defineWatchPlugins() with its default list,
fields.watchPlugins.
| Entry | Package | Options |
|---|---|---|
jest-watch-suspend |
jest-watch-suspend |
none |
jest-watch-toggle-config |
jest-watch-toggle-config |
{ setting: 'collectCoverage' } |
jest-watch-toggle-config |
jest-watch-toggle-config |
{ setting: 'verbose' } |
jest-watch-typeahead/filename |
jest-watch-typeahead |
none |
jest-watch-typeahead/testname |
jest-watch-typeahead |
none |
What each plugin does in jest --watch is documented by the plugin’s package.
Packages it needs
Section titled “Packages it needs”extract.extractPackages() on the preset returns:
['jest-watch-suspend', 'jest-watch-toggle-config', 'jest-watch-typeahead']All three are optional peers of @repobuddy/jest. Install them when you use watch or any -watch preset.
The -watch variants
Section titled “The -watch variants”For every base preset, <name>-watch equals { ...<name>, ...watch }. A check against the built presets confirmed
this for all eight pairs: ts, ts-esm, ts-cjs, js-esm, js-cjs, jsdom-ts, jsdom-ts-esm, jsdom-ts-cjs.
Behavior
Section titled “Behavior”watchPluginsis a global Jest option. In a multi-project config, Jest reads it from the root config only. A-watchpreset set inside a project adds no plugins: in a scratch run with Jest 30,jest --showConfigshowed nowatchPluginsuntil the root config usedwatch.watchsets nothing else: no environment, transform, roots, or test patterns.
Examples
Section titled “Examples”Root config of a multi-project repository, with one base preset per project:
export default { preset: '@repobuddy/jest/presets/watch', projects: ['<rootDir>/packages/*'],}export default { preset: '@repobuddy/jest/presets/ts-esm',}