> ## Documentation Index
> Fetch the complete documentation index at: https://bun-1dd33a4e-farm-dc5e99a7-serve-route-target-normalization.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Bail early with the Bun test runner

Use the `--bail` flag to bail on a test run after a single failure. This is useful for aborting as soon as possible in a continuous integration environment.

```sh terminal icon="terminal" theme={null}
bun test --bail
```

***

To bail after a certain threshold of failures, optionally specify a number after the flag.

```sh terminal icon="terminal" theme={null}
# bail after 10 failures
bun test --bail=10
```

***

See [Docs > Test runner](/test) for complete documentation of `bun test`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.