agentsclimarketplace

Bun test

Skill theseus-run/theseus/.agents/skills/bun-test

the harness rebuilds itself — agents rewrite agents, skills replace skills.

Install
npx -y skills add theseus-run/theseus --skill bun-test

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when creating, modifying, debugging, or running Bun tests with bun:test, including package-local test commands, async tests, mocks, spies, snapshots, and Effect.runPromise test boundaries.

SKILL.md

2.0 KB, as published. Nobody here has run it

Bun Test

Use this skill for tests run by bun test.

Repo Facts

  • Root test command: bun run test -> bun test.
  • packages/theseus-tools has bun test src/.
  • packages/jsx-md and packages/jsx-md-beautiful-mermaid use package-local bun test.
  • Tests live beside source or under src/__tests__/.

Imports

import { describe, expect, test, beforeEach, afterEach, mock, spyOn } from "bun:test";

Use only the APIs needed by the test. Keep setup close to the tests unless it is reused across files.

Test Shape

  • Test behavior through public exports where practical.
  • Use narrow tests for boundary behavior: schema failures, typed failures, serialization, stream completion, and runtime lifecycle.
  • For Effect code, run effects at the test boundary with Effect.runPromise.
  • Assert typed failures by _tag and fields, not by brittle stringified output.
  • For streams, assert both emitted values and completion behavior.
  • For background fibers, assert interruption, shutdown, or result handoff.

Mocks And Spies

  • Use mock for small injected functions.
  • Use spyOn when observing object methods.
  • Restore mocks in afterEach when they can leak state.
  • Prefer dependency injection or test layers over module mocking for Effect services.

Commands

  • Whole repo: bun run test.
  • Specific file: bun test path/to/file.test.ts.
  • Package scope: run the package script if present.
  • Name filter: bun test -t "pattern".
  • Watch mode is for local iteration, not final verification.

Anti-Patterns

  • Do not leave test.only or focus filters in committed tests.
  • Do not use sleeps to paper over async lifecycle bugs.
  • Do not assert implementation details when public behavior is available.
  • Do not update snapshots unless the output change is intentional and reviewed.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.