bun-test-fix

Rewrite JavaScript and TypeScript test files to comply with Bun test rules.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/ryan-mahoney/ryan-llm-skills --skill bun-test-fix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bun-test-fix
Source: https://github.com/ryan-mahoney/ryan-llm-skills/tree/main/skills/bun-test-fix
Command: npx skills add https://github.com/ryan-mahoney/ryan-llm-skills --skill bun-test-fix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fixes test files to comply with Bun test rules defined in AGENTS.md, eliminating common pitfalls in test suites.

Core Features & Use Cases

  • Audit a target test file against AGENTS.md Test Rules and rewrite it to use bun:test, replacing legacy assertion libraries and modernizing mocks with deps injection when supported.
  • Ensure deterministic, robust tests by removing mock leakage and aligning with Bun's testing conventions across JavaScript/TypeScript projects.

Quick Start

Audit a specified test file to rewrite it for Bun tests and proper deps-injection where applicable.

Frequently Asked Questions about bun-test-fix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a Bun test file to comply with AGENTS.md rules?

To fix a Bun test file, audit it against AGENTS.md Test Rules and rewrite it to use bun:test, replacing legacy assertion libraries and modernizing mocks with deps injection when supported by the subject under test.

What is the best way to upgrade legacy JavaScript test assertions for Bun?

Upgrading legacy JavaScript test assertions for Bun involves replacing existing assertion libraries with bun:test equivalents, ensuring deterministic test execution and aligning with Bun's testing conventions across JavaScript and TypeScript projects.

How do I handle mock leakage in TypeScript test suites using Bun?

Handling mock leakage in TypeScript test suites using Bun requires modernizing mocks with deps injection when supported by the subject under test, removing leakage and ensuring robust, deterministic test execution.

Does this Bun test rewrite strategy apply to both JavaScript and TypeScript projects?

Yes, this Bun test rewrite strategy applies to both JavaScript and TypeScript test suites, covering assertion upgrades, mock handling, and ensuring deps injection when supported by the subject under test.

When do I need to inject deps in a Bun test rewrite?

You need to inject deps in a Bun test rewrite when the subject under test supports dependency injection, which specifies a targeted rewrite strategy to modernize mocks and ensure deterministic, robust tests.

Why does my rewritten Bun test still fail AGENTS.md Test Rules validation?

A rewritten Bun test fails AGENTS.md Test Rules validation if assertion upgrades, mock handling, or deps injection were not properly applied, requiring a re-audit of the test file against the specified rules.