diff --git a/scripts/test.sh b/scripts/test.sh index b40025d..16a5577 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -42,7 +42,13 @@ if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm run lint); else echo "[test echo "[test.sh] 4/6 unit + integration" if [ $HAS_BACKEND -eq 1 ]; then (cd backend && mvn -B test); else echo "[test.sh] skip backend test"; fi -if [ $HAS_FRONTEND -eq 1 ]; then (cd frontend && npm test -- --run); else echo "[test.sh] skip frontend test"; fi +if [ $HAS_FRONTEND -eq 0 ]; then + echo "[test.sh] skip frontend test" +elif node -e "process.exit(require('./frontend/package.json').scripts?.test?0:1)" >/dev/null 2>&1; then + (cd frontend && npm test -- --run) +else + echo "[test.sh] skip frontend test (no 'test' script in frontend/package.json)" +fi echo "[test.sh] 5/6 E2E" echo "[test.sh] e2e 略"