Bun Writing Tests

Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers

9 stars 1 forksTesting & QA

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add jarle/bun-skills --skill Bun Writing tests
Manual install
git clone --depth 1 https://github.com/jarle/bun-skills.git /tmp/bun-skills
mkdir -p ~/.claude/skills
cp -r /tmp/bun-skills/skills/bun-test-writing-tests ~/.claude/skills/Bun-Writing-tests

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Writing tests

> Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers

Define tests with a Jest-like API imported from the built-in `bun:test` module. Long term, Bun aims for complete Jest compatibility; at the moment, a limited set of expect matchers are supported.

## Basic Usage

To define a simple test:

```ts title="math.test.ts" icon="https://mintcdn.com/bun-1dd33a4e/nIz6GtMH5K-dfXeV/icons/typescript.svg?fit=max&auto=format&n=nIz6GtMH5K-dfXeV&q=85&s=5d73d76daf7eb7b158469d8c30d349b0" theme={"theme":{"light":"github-light","dark":"dracula"}}
import { expect, test } from "bun:test";

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

### Grouping Tests

Tests can be grouped into suites with `describe`.

```ts title="math.test.ts" icon="https://mintcdn.com/bun-1dd33a4e/nIz6GtMH5K-dfXeV/icons/typescript.svg?fit=max&auto=format&n=nIz6GtMH5K-dfXeV&q=85&s=5d73d76daf7eb7b158469d8c30d349b0" theme={"theme":{"light":"github-light","dark":"dracula"}}
import { expect, test, describe } from "bun:test";

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

  test("2 * 2", () => {
    expect(2 * 2).toBe(4);
  });
});
```

### Async Tests

Tests can be async.
Read the full skill on GitHub

Details

Skill name
Bun Writing tests
Path
skills/bun-test-writing-tests/SKILL.md
License
MIT
Repo updated
24 February 2026

FAQ

What does the Bun Writing Tests skill do?

Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers

How do I install the Bun Writing Tests skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add jarle/bun-skills --skill Bun Writing tests. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Bun Writing Tests popular?

It lives in jarle/bun-skills, which has 9 GitHub stars and 1 forks.

Related skills

Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.