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

# Run tests with Bun

> Execute tests using Bun's test runner

Bun includes a fast, Jest-compatible test runner.

## Run All Tests

```bash theme={null}
bun test
```

## Run Specific File

```bash theme={null}
bun test math.test.ts
```

## Watch Mode

```bash theme={null}
bun test --watch
```

## Example Test

```typescript math.test.ts theme={null}
import { test, expect } from "bun:test";

test("addition", () => {
  expect(2 + 2).toBe(4);
});

test("async test", async () => {
  const result = await fetchData();
  expect(result).toBeDefined();
});
```

See [Test Runner](/cli/test) for complete documentation.
