diff --git a/scripts/test.js b/scripts/test.js index 9c17521c..520c3464 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -16,27 +16,8 @@ process.on('unhandledRejection', err => { require('../config/env') const jest = require('jest') -const execSync = require('child_process').execSync let argv = process.argv.slice(2) -function isInGitRepository () { - try { - execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' }) - return true - } catch (e) { - return false - } -} - -function isInMercurialRepository () { - try { - execSync('hg --cwd . root', { stdio: 'ignore' }) - return true - } catch (e) { - return false - } -} - // Watch unless on CI, in coverage mode, or explicitly running all tests if ( !process.env.CI && @@ -44,8 +25,7 @@ if ( argv.indexOf('--watchAll') === -1 ) { // https://github.com/facebook/create-react-app/issues/5210 - const hasSourceControl = isInGitRepository() || isInMercurialRepository() - argv.push(hasSourceControl ? '--watch' : '--watchAll') + argv.push('--watchAll') } jest.run(argv)