Skip to content

Commit 4ed28fd

Browse files
committed
Add optional flow to end to end testing
1 parent 251bd9b commit 4ed28fd

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tasks/e2e.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ test -e build/static/js/*.js
143143
test -e build/static/css/*.css
144144
test -e build/static/media/*.svg
145145
test -e build/favicon.ico
146+
test ! -e .flowconfig
146147

147148
# Run tests with CI flag
148149
CI=true npm test
@@ -152,6 +153,23 @@ CI=true npm test
152153
# Test the server
153154
npm start -- --smoke-test
154155

156+
# Test optional flow enabling
157+
cp src/App.js src/App.backup.js
158+
cp .gitignore .gitignore.backup
159+
echo "
160+
/* @flow */
161+
var wrong: string = 0;
162+
" >> src/App.js
163+
npm start -- --smoke-test || true
164+
test -e .flowconfig
165+
test -d flow-typed
166+
cat .gitignore | grep flow-typed
167+
rm src/App.js .gitignore
168+
cp src/App.backup.js src/App.js
169+
cp .gitignore.backup .gitignore
170+
rm src/App.backup.js .gitignore.backup .flowconfig
171+
rm -rf flow-typed
172+
155173
# ******************************************************************************
156174
# Finally, let's check that everything still works after ejecting.
157175
# ******************************************************************************
@@ -173,6 +191,7 @@ test -e build/static/js/*.js
173191
test -e build/static/css/*.css
174192
test -e build/static/media/*.svg
175193
test -e build/favicon.ico
194+
test ! -e .flowconfig
176195

177196
# Run tests, overring the watch option to disable it.
178197
# `CI=true npm test` won't work here because `npm test` becomes just `jest`.
@@ -185,6 +204,22 @@ npm test -- --watch=no
185204
# Test the server
186205
npm start -- --smoke-test
187206

207+
# Test optional flow enabling
208+
cp src/App.js src/App.backup.js
209+
cp .gitignore .gitignore.backup
210+
echo "
211+
/* @flow */
212+
var wrong: string = 0;
213+
" >> src/App.js
214+
npm start -- --smoke-test || true
215+
test -e .flowconfig
216+
test -d flow-typed
217+
cat .gitignore | grep flow-typed
218+
rm src/App.js .gitignore
219+
cp src/App.backup.js src/App.js
220+
cp .gitignore.backup .gitignore
221+
rm src/App.backup.js .gitignore.backup .flowconfig
222+
rm -rf flow-typed
188223

189224
# ******************************************************************************
190225
# Test --scripts-version with a version number

0 commit comments

Comments
 (0)