Skip to content

Commit

Permalink
Fix watch mode when a pattern is passed (#5026)
Browse files Browse the repository at this point in the history
* Fix watch mode when a pattern is passed

* Update normalize.js
  • Loading branch information
mjesun authored and cpojer committed Dec 6, 2017
1 parent 88ad6b5 commit 94101e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/jest-config/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,12 @@ export default function normalize(options: InitialOptions, argv: Argv) {

newOptions.testFailureExitCode = parseInt(newOptions.testFailureExitCode, 10);

if (argv.all || newOptions.testPathPattern) {
if (argv.all) {
newOptions.onlyChanged = false;
} else if (newOptions.testPathPattern) {
// When passing a test path pattern we don't want to only monitor changed
// files unless `--watch` is also passed.
newOptions.onlyChanged = newOptions.watch;
}

newOptions.updateSnapshot =
Expand Down

0 comments on commit 94101e9

Please sign in to comment.