Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt tests if interactive watch plugin key is pressed #7222

Merged
merged 2 commits into from
Oct 20, 2018

Conversation

rogeliog
Copy link
Contributor

@rogeliog rogeliog commented Oct 19, 2018

Summary

This PR fixes a regression that was introduced here. https://github.com/facebook/jest/pull/5399/files#diff-d8a3d0a3a8b42ab87b18835ad8f7cb46L208

Pressing a key of an interactive watch plugin should interrupt the running tests, otherwise, the output gets messed up.

Test plan

Before

Pressing "p" while tests were running, does not interrupt test run and the output breaks.
watch-before

After

Pressing "p" while tests were running, interrupts the tests run
watch-after

@@ -321,6 +321,10 @@ export default function watch(
).find(plugin => getPluginKey(plugin, globalConfig) === key);

if (matchingWatchPlugin != null) {
if (isRunning) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something that we are already handling correctly for "non plugin" keys https://github.com/facebook/jest/pull/7222/files#diff-d8a3d0a3a8b42ab87b18835ad8f7cb46R309

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! Just missing a changelog entry 🙂

@SimenB SimenB merged commit ad5b040 into jestjs:master Oct 20, 2018
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants