AgentStack
SKILL verified MIT Self-run

Bun Test

skill-theseus-run-theseus-bun-test · by theseus-run

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.

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add skill-theseus-run-theseus-bun-test

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Bun Test? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.