Skip to content

Commit

Permalink
fix watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronabramov committed Jul 20, 2017
1 parent 2b2b9ba commit 6272637
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/jest-cli/src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ const runCLI = async (
(r: AggregatedResult) => (results = r),
);

if (argv.watch || argv.watchAll) {
// If in watch mode, return the promise that will never resolve.
// If the watch mode is interrupted, watch should handle the process
// shuttdown.
return new Promise(() => {});
}

if (!results) {
throw new Error(
'AggregatedResult must be present after test run is complete',
Expand Down

0 comments on commit 6272637

Please sign in to comment.