diff --git a/scripts/test.js b/scripts/test.js index 7d7d520dfb6..b173656b5db 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -22,18 +22,6 @@ if (debugTemplateIndex !== -1) { argv.splice(debugTemplateIndex, 1); } -// Don't pass this option to Jest either -const smokeTestIndex = argv.indexOf('--smoke-test'); -if (smokeTestIndex !== -1) { - argv.splice(smokeTestIndex, 1); - - // When running end-to-end test, disable watching - const watchIndex = argv.indexOf('--watch'); - if (watchIndex !== -1) { - argv.splice(watchIndex, 1); - } -} - argv.push('--config', JSON.stringify(createJestConfig( relativePath => path.resolve(__dirname, '..', relativePath), path.resolve(paths.appSrc, '..') diff --git a/tasks/e2e.sh b/tasks/e2e.sh index fd770285407..1e841d8699a 100755 --- a/tasks/e2e.sh +++ b/tasks/e2e.sh @@ -12,7 +12,8 @@ cd "$(dirname "$0")" function cleanup { echo 'Cleaning up.' cd $initial_path - rm ../template/src/__tests__/__snapshots__/App-test.js.snap + # Uncomment when snapshot testing is enabled by default: + # rm ../template/src/__snapshots__/App.test.js.snap rm -rf $temp_cli_path $temp_app_path } @@ -53,12 +54,9 @@ perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' package.json npm install scripts_path=$PWD/`npm pack` -# lint +# Lint ./node_modules/.bin/eslint --ignore-path .gitignore ./ -# Test local start command -npm start -- --smoke-test - # Test local build command npm run build @@ -69,9 +67,13 @@ test -e build/static/css/*.css test -e build/static/media/*.svg test -e build/favicon.ico -# Run tests -npm run test -test -e template/src/__tests__/__snapshots__/App-test.js.snap +# Run tests, overriding watch option to disable it +npm test -- --watch=no +# Uncomment when snapshot testing is enabled by default: +# test -e template/src/__snapshots__/App.test.js.snap + +# Test local start command +npm start -- --smoke-test # Pack CLI cd global-cli @@ -99,10 +101,10 @@ test -e build/static/css/*.css test -e build/static/media/*.svg test -e build/favicon.ico -# Run tests -npm test --smoke-test +# Run tests, overriding watch option to disable it +npm test -- --watch=no # Uncomment when snapshot testing is enabled by default: -# test -e src/__tests__/__snapshots__/App-test.js.snap +# test -e src/__snapshots__/App.test.js.snap # Test the server npm start -- --smoke-test @@ -118,10 +120,10 @@ test -e build/static/css/*.css test -e build/static/media/*.svg test -e build/favicon.ico -# Run tests -npm test -- --smoke-test +# Run tests, overriding watch option to disable it +npm test -- --watch=no # Uncomment when snapshot testing is enabled by default: -# test -e src/__tests__/__snapshots__/App-test.js.snap +# test -e src/__snapshots__/App.test.js.snap # Test the server npm start -- --smoke-test