Personal Telegram developer console for GitHub

ci: fail when no test files are discovered

davoodmehraban89 committed Oct 2, 2026 at 22:48 UTC 601468c8273ec952b49766d3397a659ddd0dc153
1 file changed +15
.github/workflows/ci.yml
+15
@@ -25,5 +25,20 @@ jobs:
25 - name: Install dependencies
26 run: npm install --no-audit --no-fund
27
28 + - name: Verify test discovery
29 + shell: bash
30 + run: |
31 + set -euo pipefail
32 + shopt -s nullglob
33 + tests=(test/*.test.js)
34 +
35 + if (( ${#tests[@]} == 0 )); then
36 + echo "::error::No test/*.test.js files were discovered"
37 + exit 1
38 + fi
39 +
40 + printf 'Discovered %d test files\n' "${#tests[@]}"
41 + printf ' - %s\n' "${tests[@]}"
42 +
43 - name: Run tests
44 run: npm test