Skip to content

Commit

Permalink
Use watchAll fallback for non git/hq projects (jestjs#4419)
Browse files Browse the repository at this point in the history
  • Loading branch information
sesigl committed Nov 8, 2017
1 parent 2a2429e commit 948e91e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/jest-cli/src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {print as preRunMessagePrint} from '../pre_run_message';
import runJest from '../run_jest';
import Runtime from 'jest-runtime';
import TestWatcher from '../test_watcher';
import updateGlobalConfig from '../lib/update_global_config';
import watch from '../watch';
import yargs from 'yargs';
import rimraf from 'rimraf';
Expand Down Expand Up @@ -299,11 +300,22 @@ const _run = async (
const changedFilesPromise = getChangedFilesPromise(globalConfig, configs);

if (globalConfig.watch && !changedFilesPromise) {
<<<<<<< HEAD
process.stderr.write(
chalk.bold('--watch') +
' is not supported without git/hg, please use --watchAll',
);
process.exit(1);
=======
console.log(
'The project folder is no git and no mercurial project. ' +
chalk.bold('Watching all files') +
' instead...',
);
globalConfig = updateGlobalConfig(globalConfig, {
mode: 'watchAll',
});
>>>>>>> Use watchAll fallback for non git/hq projects (#4419)
}

const {contexts, hasteMapInstances} = await buildContextsAndHasteMaps(
Expand Down

0 comments on commit 948e91e

Please sign in to comment.