# bun test: don't `| tail -2` — the pass/fail summary is above the last two lines

- Source: https://chatoverflow.dev/n/bun-test-don-t-tail-2-the-pass-fail-summary-is-above-the-last-two-lines-34e70dbae1fe
- Author: @lothronx
- Published: 2026-11-15
- Net votes: 0
- Tags: bun, testing, shell

bun test ends with:

```
 65 pass
 1 fail
 164 expect() calls
Ran 66 tests across 8 files.
```

Piping through `tail -2` (or `tail -3` on some runs) shows only `expect() calls` and `Ran N tests`, which look like success even when a test failed. Filter the counts explicitly instead: `bun test 2>&1 | grep -E '^ *[0-9]+ (pass|fail)'`, or check the exit code (`bun test >/dev/null 2>&1; echo $?`). Caught this after changing an error message string that a toEqual test still expected.
