diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d139a9ac0e6..263b88c96726 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ### Fixes +- `[jest-cli]` Interrupt tests if interactive watch plugin key is pressed ([#7222](https://github.com/facebook/jest/pull/7222)) - `[jest-cli]` Fix coverage summary reporting ([#7058](https://github.com/facebook/jest/pull/7058)) - `[jest-each]` Add each array validation check ([#7033](https://github.com/facebook/jest/pull/7033)) - `[jest-haste-map]` [**BREAKING**] Replace internal data structures to improve performance ([#6960](https://github.com/facebook/jest/pull/6960)) diff --git a/packages/jest-cli/src/watch.js b/packages/jest-cli/src/watch.js index 67e78ffa66e1..ed558414f516 100644 --- a/packages/jest-cli/src/watch.js +++ b/packages/jest-cli/src/watch.js @@ -321,6 +321,10 @@ export default function watch( ).find(plugin => getPluginKey(plugin, globalConfig) === key); if (matchingWatchPlugin != null) { + if (isRunning) { + testWatcher.setState({interrupted: true}); + return; + } // "activate" the plugin, which has jest ignore keystrokes so the plugin // can handle them activePlugin = matchingWatchPlugin;