mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-01 09:01:04 +08:00
Catch "No tests found" during CI (#2387)
This commit is contained in:
committed by
Dan Abramov
parent
58d8c5c05c
commit
5317b3f910
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user