Skip to content

Commit 5317b3f

Browse files
EnoahNetzachgaearon
authored andcommitted
Catch "No tests found" during CI (facebook#2387)
1 parent 58d8c5c commit 5317b3f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tasks/e2e-kitchensink.sh

+10
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
158158
NODE_ENV=test \
159159
npm test -- --no-cache --testPathPattern="/src/"
160160

161+
# Catch when no tests are detected
162+
testsList=$(REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
163+
CI=true \
164+
NODE_PATH=src \
165+
npm test -- --no-cache --testPathPattern="/src/" --listTests)
166+
167+
if [[ ${testsList} =~ "[]" ]]; then
168+
exit 1
169+
fi
170+
161171
# Test "development" environment
162172
tmp_server_log=`mktemp`
163173
PORT=3001 \

0 commit comments

Comments
 (0)