Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Sep 1, 2016
1 parent 413aa8e commit 6a8590f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
12 changes: 0 additions & 12 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '..')
Expand Down
30 changes: 16 additions & 14 deletions tasks/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6a8590f

Please sign in to comment.