From f5288bc0b271ebb4c87a52691ae64d1fded79d54 Mon Sep 17 00:00:00 2001 From: Rogelio Guzman Date: Fri, 19 Oct 2018 14:26:21 -0700 Subject: [PATCH 1/2] Interrupt tests if interactive watch plugin key is pressed --- packages/jest-cli/src/watch.js | 4 ++++ 1 file changed, 4 insertions(+) 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; From 68db5f5ee70a23305fe3773bc1164cdca08860ee Mon Sep 17 00:00:00 2001 From: Rogelio Guzman Date: Sat, 20 Oct 2018 08:35:01 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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))