Catch "No tests found" during CI (#2387)

This commit is contained in:
Fabrizio Castellarin
2017-05-27 21:32:12 +02:00
committed by Dan Abramov
parent 58d8c5c05c
commit 5317b3f910

View File

@@ -158,6 +158,16 @@ REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
NODE_ENV=test \
npm test -- --no-cache --testPathPattern="/src/"
# Catch when no tests are detected
testsList=$(REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
CI=true \
NODE_PATH=src \
npm test -- --no-cache --testPathPattern="/src/" --listTests)
if [[ ${testsList} =~ "[]" ]]; then
exit 1
fi
# Test "development" environment
tmp_server_log=`mktemp`
PORT=3001 \