testing-bun

testing-bun is a skill for Claude Code from LandonSchropp/agent-toolkit. It costs 14 tokens per session (586 once invoked), scanned A, original, MIT.

A testing guide for projects built with Bun, a JavaScript runtime and toolkit.

In plain words
What is it for?
Writing or modifying tests in Bun-based projects.
Why use it?
It provides context for writing or changing tests in a Bun project.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { isGitInstalled } from "../../src/commands/git.ts";.

Part of the ls-typescript plugin — 7 skills, 1 command shipped together

Good fit Writing or modifying tests in Bun-based projects.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/LandonSchropp/agent-toolkit
agentmods
npx agentmods add skills/landonschropp/agent-toolkit/testing-bun

Made for: Claude Code.

Or install ls-typescript, the plugin that ships this one along with the rest of its 7 skills, 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-bun

README.md
[![agentmods](https://agentmods.dev/badge/skills/landonschropp/agent-toolkit/testing-bun/github.svg)](https://agentmods.dev/skills/landonschropp/agent-toolkit/testing-bun)
Your own site
<a href="https://agentmods.dev/skills/landonschropp/agent-toolkit/testing-bun"><img src="https://agentmods.dev/badge/skills/landonschropp/agent-toolkit/testing-bun/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-bun

Your own site · 80×15
<a href="https://agentmods.dev/skills/landonschropp/agent-toolkit/testing-bun"><img src="https://agentmods.dev/badge/skills/landonschropp/agent-toolkit/testing-bun.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 586 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.00586
Opus 5.5 $0.00006 $0.00234
Sonnet 5.5 $0.00003 $0.00117
Haiku 4.5 $0.00001 $0.00059

Measured 11d ago against content hash 963f09bd9219, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-bun scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ls-typescript/skills/testing-bun/SKILL.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing with Bun

Fetch the Bun mocks documentation before writing or modifying tests.

Running the suite

Run the full suite via bun run test, never bun test directly. The script passes --isolate, which runs each test file in its own worker. Without it, mock.module() calls leak across files and tests fail in confusing, order-dependent ways.

For ad-hoc single-file runs, use bun test --isolate <file>.

Mock helpers

Prefer the specific mock helpers over mockImplementation:

  • mockResolvedValue(value) / mockResolvedValueOnce(value) — async functions returning a value.
  • mockRejectedValue(error) / mockRejectedValueOnce(error) — async functions that throw.
  • mockReturnValue(value) / mockReturnValueOnce(value) — sync functions.

Only reach for mockImplementation when behavior depends on arguments or call count.

Set mock return values close to the test that asserts on them, with the concrete value the test needs. Indirection through shared variables or transformations makes tests harder to read.

Spying on object methods

Never reassign properties on global or imported objects to stub them — use spyOn. Re-spy in beforeEach so each test starts from a known state.

// Good — spy, scoped to the test that needs it
import { spyOn } from "bun:test";

// Bad — reassigns the property
const original = Bun.stdin;
beforeEach(() => {
  // @ts-expect-error
  Bun.stdin = { json: () => Promise.resolve(payload) };
});
afterEach(() => {
  // @ts-expect-error
  Bun.stdin = original;
});

it("processes the payload", async () => {
  spyOn(Bun.stdin, "json").mockResolvedValue({ hook_event_name: "Stop" });
  // ... assertions
});

Mocking modules

Use static imports — Bun's ESM live bindings let mock.module() update modules that have already been imported. No dynamic await import() needed.

mock.module() returns a promise, so it must be awaited:

import { isGitInstalled } from "../../src/commands/git.ts";
import { describe, expect, it, mock } from "bun:test";

const runCommandMock = mock(() => Promise.resolve({ exitCode: 0, stdout: "", stderr: "" }));

await mock.module("../../src/commands/shell.ts", () => ({
  runCommand: runCommandMock,
}));

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago Changed 963f09bd9219
  2. 2mo ago Changed · +1 lines · +4 tokens per session 3d08bd1785bd
  3. 3mo ago First seen · 70 lines · 10 tokens per session scan A e6e4b1012397

Subscribe to this mod's changes

testing-bun is a skill published in the GitHub repository LandonSchropp/agent-toolkit (3 stars, last pushed today), licensed MIT. It adds 14 tokens to every session and 586 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

testing-bun compared with skills from other repositories

testing-bun next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testing-bunLandonSchropp/agent-toolkitSkill3todayMITA14Claude Code
cf-clicloudflare/skillsSkill3.5k5d agoApache-2.0A78Claude Code
workers-best-practicescloudflare/skillsSkill3.5k5d agoApache-2.0A25Claude Code
story-origin-checkelvisun/newsjackSkill1.7k5d agoMITA40Claude Code
relevance-coarse-filterelvisun/newsjackSkill1.7k5d agoMITA57Claude Code
skill-changelogluongnv89/asmSkill976yesterdayMITA53Claude Code
character-profileGongLingRui/screen-creative-skillsSkill5111mo agoMITA46Claude Code