Skip to content

Basic bun:test guide covering syntax, assertions, modifiers, and CLI options for the built-in runner.

CCM score
51 of 100
skills.sh installs
485
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers test files, describe/it blocks, parameterized tests, concurrent execution, and common matchers for expect
  • Includes modifiers test.skip, test.only, test.todo, and test.failing, plus test.each for table-driven cases
  • Flags test.only as local-debugging only, since bun test exits non-zero in CI when a file uses it
  • Lists CLI options such as --timeout, --bail, --watch, --randomize, and -t for name filtering

Install

$ npx -y skills add secondsky/claude-skills --skill bun-test-basics -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Bun Test Basics

Bun ships with a fast, built-in, Jest-compatible test runner. Tests run with the Bun runtime and support TypeScript/JSX natively.

Quick Start

# Run all tests
bun test

# Run specific file
bun test ./test/math.test.ts

# Run tests matching pattern
bun test --test-name-pattern "addition"

Writing Tests

import { test, expect, describe } from "bun:test";

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

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

  test("subtraction", () => {
    expect(5 - 3).toBe(2);
  });
});

Test File Patterns

Bun discovers test files matching:

  • *.test.{js|jsx|ts|tsx}
  • *_test.{js|jsx|ts|tsx}
  • *.spec.{js|jsx|ts|tsx}
  • *_spec.{js|jsx|ts|tsx}

Test Modifiers

// Skip a test
test.skip("not ready", () => {
  // won't run
});

// Only run this test
test.only("focus on this", () => {
  // other tests won't run
});
// NOTE: in Bun 1.3+ `bun test` exits non-zero in CI when a file uses
// `test.only`. Use it for local debugging only — never commit it.

// Placeholder for future test
test.todo("implement later");

Details

Repository
github.com/secondsky/claude-skills
Category
Testing & QA
First seen
Jun 3, 2026

Questions

What does the bun-test-basics skill cover?

It covers bun:test syntax, assertions, describe and it blocks, test.skip, test.only and test.each, plus basic test patterns. The skill's SKILL.md explains how to run tests with bun test and how to write matchers like toBe, toEqual and toThrow.

How do I install the bun-test-basics skill?

Run npx -y skills add secondsky/claude-skills --skill bun-test-basics -y in your project. Once installed, the agent can help you write and run Bun tests using the bun:test runner.

Which skills rank alongside bun-test-basics in the Testing & QA category?

bun-test-basics sits in the Testing & QA category on Claude Marketplaces, alongside tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui. Its focus is narrower than those, centered on Bun's built-in test runner and its syntax.

More from secondsky/claude-skills

All 116

Similar to Bun Test Basics

More Testing & QA