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

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

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

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

***

监听模式会在文件发生变化时重新启动正在运行的 Bun 进程。速度很快。在此示例中，编辑器在每次按键时保存文件。

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

***

参见 [`bun test`](/test)。
