> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Bun 的监听模式运行测试

使用 `--watch` 标志以监听模式运行测试。

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun test --watch
```

***

这将在检测到文件更改时重启正在运行的 Bun 进程。速度很快。在此示例中，编辑器配置为每次按键时保存文件。

<Frame>
  ![在 Bun 中监听模式运行测试](https://github.com/oven-sh/bun/assets/3084745/dc49a36e-ba82-416f-b960-1c883a924248)
</Frame>

***

完整的测试运行器文档请查看 [文档 > 测试运行器](/test)。
