From 5bf0745aaeceeb7b3c83b27ca5ead023cccb4d82 Mon Sep 17 00:00:00 2001 From: Enoah Netzach Date: Sat, 27 May 2017 18:56:14 +0200 Subject: [PATCH] Catch "No tests found" during CI --- tasks/e2e-kitchensink.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 2295615e8ea..9d60d6e2935 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 \