Skip to content

Commit 6a8590f

Browse files
committed
Fix e2e test
1 parent 413aa8e commit 6a8590f

File tree

2 files changed

+16
-26
lines changed

2 files changed

+16
-26
lines changed

scripts/test.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ if (debugTemplateIndex !== -1) {
2222
argv.splice(debugTemplateIndex, 1);
2323
}
2424

25-
// Don't pass this option to Jest either
26-
const smokeTestIndex = argv.indexOf('--smoke-test');
27-
if (smokeTestIndex !== -1) {
28-
argv.splice(smokeTestIndex, 1);
29-
30-
// When running end-to-end test, disable watching
31-
const watchIndex = argv.indexOf('--watch');
32-
if (watchIndex !== -1) {
33-
argv.splice(watchIndex, 1);
34-
}
35-
}
36-
3725
argv.push('--config', JSON.stringify(createJestConfig(
3826
relativePath => path.resolve(__dirname, '..', relativePath),
3927
path.resolve(paths.appSrc, '..')

tasks/e2e.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ cd "$(dirname "$0")"
1212
function cleanup {
1313
echo 'Cleaning up.'
1414
cd $initial_path
15-
rm ../template/src/__tests__/__snapshots__/App-test.js.snap
15+
# Uncomment when snapshot testing is enabled by default:
16+
# rm ../template/src/__snapshots__/App.test.js.snap
1617
rm -rf $temp_cli_path $temp_app_path
1718
}
1819

@@ -53,12 +54,9 @@ perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' package.json
5354
npm install
5455
scripts_path=$PWD/`npm pack`
5556

56-
# lint
57+
# Lint
5758
./node_modules/.bin/eslint --ignore-path .gitignore ./
5859

59-
# Test local start command
60-
npm start -- --smoke-test
61-
6260
# Test local build command
6361
npm run build
6462

@@ -69,9 +67,13 @@ test -e build/static/css/*.css
6967
test -e build/static/media/*.svg
7068
test -e build/favicon.ico
7169

72-
# Run tests
73-
npm run test
74-
test -e template/src/__tests__/__snapshots__/App-test.js.snap
70+
# Run tests, overriding watch option to disable it
71+
npm test -- --watch=no
72+
# Uncomment when snapshot testing is enabled by default:
73+
# test -e template/src/__snapshots__/App.test.js.snap
74+
75+
# Test local start command
76+
npm start -- --smoke-test
7577

7678
# Pack CLI
7779
cd global-cli
@@ -99,10 +101,10 @@ test -e build/static/css/*.css
99101
test -e build/static/media/*.svg
100102
test -e build/favicon.ico
101103

102-
# Run tests
103-
npm test --smoke-test
104+
# Run tests, overriding watch option to disable it
105+
npm test -- --watch=no
104106
# Uncomment when snapshot testing is enabled by default:
105-
# test -e src/__tests__/__snapshots__/App-test.js.snap
107+
# test -e src/__snapshots__/App.test.js.snap
106108

107109
# Test the server
108110
npm start -- --smoke-test
@@ -118,10 +120,10 @@ test -e build/static/css/*.css
118120
test -e build/static/media/*.svg
119121
test -e build/favicon.ico
120122

121-
# Run tests
122-
npm test -- --smoke-test
123+
# Run tests, overriding watch option to disable it
124+
npm test -- --watch=no
123125
# Uncomment when snapshot testing is enabled by default:
124-
# test -e src/__tests__/__snapshots__/App-test.js.snap
126+
# test -e src/__snapshots__/App.test.js.snap
125127

126128
# Test the server
127129
npm start -- --smoke-test

0 commit comments

Comments
 (0)