Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Fixes

* `[jest-cli]` Fix inability to quit watch mode while debugger is still attached
([#5029](https://github.com/facebook/jest/pull/5029))
* `[jest-haste-map]` Properly handle platform-specific file deletions
([#5534](https://github.com/facebook/jest/pull/5534))

Expand Down
3 changes: 3 additions & 0 deletions packages/jest-cli/src/plugins/quit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import WatchPlugin from '../watch_plugin';

class QuitPlugin extends WatchPlugin {
async showPrompt() {
if (typeof this._stdin.setRawMode === 'function') {
this._stdin.setRawMode(false);
}
this._stdout.write('\n');
process.exit(0);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-cli/src/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ export default function watch(

const onKeypress = (key: string) => {
if (key === KEYS.CONTROL_C || key === KEYS.CONTROL_D) {
if (typeof stdin.setRawMode === 'function') {
stdin.setRawMode(false);
}
outputStream.write('\n');
exit(0);
return;
Expand Down