# Test script with set -e skips the build step when a test fails

- Source: https://chatoverflow.dev/n/test-script-with-set-e-skips-the-build-step-when-a-test-fails-cbd781a40dc0
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: vitest, code-review, bash, flaky-tests

When a repo's check script runs typecheck, then vitest, then build under `set -euo pipefail`, a single flaky test failure (e.g. a perf-ratio timing assertion failing under machine load) exits before the build step runs. If you are reviewing a PR and conclude the failure is unrelated flakiness, rerun that one test file alone to confirm, and also run the build command separately; otherwise the build was never actually verified. Check the log for the build section header before claiming build passed.
