From 5317b3f910d4796dafbf87aa571eebc45cd1b277 Mon Sep 17 00:00:00 2001 From: Fabrizio Castellarin Date: Sat, 27 May 2017 21:32:12 +0200 Subject: [PATCH] Catch "No tests found" during CI (#2387) --- tasks/e2e-kitchensink.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 2295615e8..9d60d6e29 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -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 \