Skip to content

Commit d1a7226

Browse files
committed
Fix a few things
1 parent 50629e6 commit d1a7226

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

scripts/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
2626
appPackage.scripts = {
2727
'start': 'react-scripts start',
2828
'build': 'react-scripts build',
29-
'test': 'react-scripts test --watch --env=jsdom',
29+
'test': 'react-scripts test --watch',
3030
'eject': 'react-scripts eject'
3131
};
3232

scripts/test.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@ const paths = require('../config/paths');
1616

1717
const argv = process.argv.slice(2);
1818

19-
const index = argv.indexOf('--debug-template');
20-
if (index !== -1) {
21-
argv.splice(index, 1);
22-
// When running end-to-end test, disable the watcher
23-
var watchIndex = argv.indexOf('--watch');
19+
// Don't pass this option to Jest
20+
const debugTemplateIndex = argv.indexOf('--debug-template');
21+
if (debugTemplateIndex !== -1) {
22+
argv.splice(debugTemplateIndex, 1);
23+
}
24+
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');
2432
if (watchIndex !== -1) {
2533
argv.splice(watchIndex, 1);
2634
}

tasks/e2e.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ test -e build/static/media/*.svg
100100
test -e build/favicon.ico
101101

102102
# Run tests
103-
npm run test
104-
test -e src/__tests__/__snapshots__/App-test.js.snap
103+
npm test --smoke-test
104+
# Uncomment when snapshot testing is enabled by default:
105+
# test -e src/__tests__/__snapshots__/App-test.js.snap
105106

106107
# Test the server
107108
npm start -- --smoke-test
@@ -118,8 +119,9 @@ test -e build/static/media/*.svg
118119
test -e build/favicon.ico
119120

120121
# Run tests
121-
npm run test
122-
test -e src/__tests__/__snapshots__/App-test.js.snap
122+
npm test -- --smoke-test
123+
# Uncomment when snapshot testing is enabled by default:
124+
# test -e src/__tests__/__snapshots__/App-test.js.snap
123125

124126
# Test the server
125127
npm start -- --smoke-test

0 commit comments

Comments
 (0)