Write Tests
grafana/synthetic-monitoring-app
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.
Configure Bun's built-in test runner with Jest-compatible APIs.
$ npx skills add involvex/youtube-music-cli --skill bun-test -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install involvex/youtube-music-cli bun-test --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/involvex/youtube-music-cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/bun-test .claude/skills/bun-test && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "bun-test" agent skill from https://github.com/involvex/youtube-music-cli/tree/main/.agents/skills/bun-test into .claude/skills/bun-test/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bun-test", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/involvex/youtube-music-cli/tree/main/.agents/skills/bun-testType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add involvex/youtube-music-cli --skill bun-test -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install involvex/youtube-music-cli bun-test --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/involvex/youtube-music-cli.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/bun-test .agents/skills/bun-test && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bun-test" agent skill from https://github.com/involvex/youtube-music-cli/tree/main/.agents/skills/bun-test into .agents/skills/bun-test/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bun-test", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add involvex/youtube-music-cli --skill bun-test -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install involvex/youtube-music-cli bun-test --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/involvex/youtube-music-cli.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/bun-test .cursor/skills/bun-test && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bun-test" agent skill from https://github.com/involvex/youtube-music-cli/tree/main/.agents/skills/bun-test into .cursor/skills/bun-test/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bun-test", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/involvex/youtube-music-cli.git --path .agents/skills/bun-test--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add involvex/youtube-music-cli --skill bun-test -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install involvex/youtube-music-cli bun-test --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/involvex/youtube-music-cli.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/bun-test .gemini/skills/bun-test && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bun-test" agent skill from https://github.com/involvex/youtube-music-cli/tree/main/.agents/skills/bun-test into .gemini/skills/bun-test/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bun-test", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install involvex/youtube-music-cli bun-testInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add involvex/youtube-music-cli --skill bun-test -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/involvex/youtube-music-cli.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/bun-test .github/skills/bun-test && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bun-test" agent skill from https://github.com/involvex/youtube-music-cli/tree/main/.agents/skills/bun-test into .github/skills/bun-test/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bun-test", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add involvex/youtube-music-cli --skill bun-test -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install involvex/youtube-music-cli bun-test --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/involvex/youtube-music-cli.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/bun-test .opencode/skills/bun-test && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bun-test" agent skill from https://github.com/involvex/youtube-music-cli/tree/main/.agents/skills/bun-test into .opencode/skills/bun-test/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bun-test", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
bun-testConfigure Bun's built-in test runner with Jest-compatible APIs.
Bun Test is an agent skill from involvex/youtube-music-cli. Configure Bun's built-in test runner with Jest-compatible APIs. Use when setting up testing infrastructure, writing unit/integration/snapshot tests, migrating from Jest, or configuring test coverage. 3-10x faster than Jest.
Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/examples.md`, `references/jest-migration.md` and `references/mocking.md`). Compatibility notes: Requires Bun 1.0+
It sits in Testing & QA, covering Unit testing and Test coverage. It works with Jest and YouTube. The repository describes itself as: A powerful Terminal User Interface (TUI) music player for YouTube Music. The licence is MIT.
9 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a0d4e49. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
BashWriteReadFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
bunFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Requires Bun 1.0+
From compatibility in the SKILL.md frontmatter.
Bun Test loads about 2.3k tokens when it runs, and up to ~7.2k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 308 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
allowed-tools: Bash, Write, ReadAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from involvex/youtube-music-cli at commit a0d4e49, republished under its MIT licence (© involvex). 308 words, ~2,265 tokens.
.claude/skills/bun-test/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.Set up Bun's built-in test runner with Jest-compatible APIs and significantly faster execution (3-10x faster than Jest).
For detailed patterns, see:
# Verify Bun installation
bun --version
# Check if project exists
ls -la package.jsonAsk the user what type of testing they need:
# Create test directories
mkdir -p tests/{unit,integration,fixtures}Recommended structure:
project/
├── src/
│ ├── utils.ts
│ └── components/
├── tests/
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ ├── fixtures/ # Test data
│ └── setup.ts # Global setup
├── package.json
└── bunfig.toml # Test configurationCreate bunfig.toml in project root:
[test]
# Preload files before running tests
preload = ["./tests/setup.ts"]
# Code coverage
coverage = true
coverageDir = "coverage"
coverageThreshold = 80
# Timeouts (in milliseconds)
timeout = 5000
# Bail after first failure
bail = falseCreate tests/setup.ts:
import { beforeAll, afterAll, beforeEach, afterEach } from "bun:test";
// Global test setup
beforeAll(() => {
console.log("🧪 Starting test suite");
process.env.NODE_ENV = "test";
});
afterAll(() => {
console.log("✅ Test suite complete");
});
// Reset mocks before each test
beforeEach(() => {
// Clear mock state
});
afterEach(() => {
// Cleanup after each test
});
// Global test utilities
globalThis.testHelpers = {
wait: (ms: number) => new Promise(resolve => setTimeout(resolve, ms)),
};Create tests/unit/example.test.ts:
import { describe, it, expect, test } from "bun:test";
// Simple test
test("addition works", () => {
expect(1 + 1).toBe(2);
});
// Describe blocks for organization
describe("Array utilities", () => {
it("should filter even numbers", () => {
const numbers = [1, 2, 3, 4, 5, 6];
const evens = numbers.filter(n => n % 2 === 0);
expect(evens).toEqual([2, 4, 6]);
expect(evens).toHaveLength(3);
});
});
// Async tests
describe("Async operations", () => {
it("should handle promises", async () => {
const result = await Promise.resolve(42);
expect(result).toBe(42);
});
});For more test examples (API testing, database testing, etc.), see examples.md.
import { describe, it, expect, mock, spyOn } from "bun:test";
describe("Mock functions", () => {
it("should create mock functions", () => {
const mockFn = mock((x: number) => x * 2);
const result = mockFn(5);
expect(result).toBe(10);
expect(mockFn).toHaveBeenCalledTimes(1);
expect(mockFn).toHaveBeenCalledWith(5);
});
it("should spy on methods", () => {
const obj = {
method: (x: number) => x * 2,
};
const spy = spyOn(obj, "method");
obj.method(5);
expect(spy).toHaveBeenCalledWith(5);
expect(spy).toHaveReturnedWith(10);
});
});For advanced mocking patterns, see mocking.md.
Add test scripts:
{
"scripts": {
"test": "bun test",
"test:watch": "bun test --watch",
"test:coverage": "bun test --coverage",
"test:ui": "bun test --coverage --reporter=html"
}
}# Run all tests
bun test
# Run specific file
bun test tests/unit/utils.test.ts
# Watch mode
bun test --watch
# With coverage
bun test --coverage
# Filter by name
bun test --test-name-pattern="should handle"If migrating from Jest, see jest-migration.md for:
@jest/globals → bun:test)jest.fn() → mock())Key changes:
// Before (Jest)
import { describe, it, expect } from '@jest/globals';
const mockFn = jest.fn();
// After (Bun)
import { describe, it, expect, mock } from 'bun:test';
const mockFn = mock();import { test, expect } from "bun:test";
function add(a: number, b: number): number {
return a + b;
}
test("add function", () => {
expect(add(2, 3)).toBe(5);
expect(add(-1, 1)).toBe(0);
});test("should throw errors", () => {
const throwError = () => {
throw new Error("Something went wrong");
};
expect(throwError).toThrow("Something went wrong");
expect(throwError).toThrow(Error);
});
test("should reject promises", async () => {
const asyncReject = async () => {
throw new Error("Async error");
};
await expect(asyncReject()).rejects.toThrow("Async error");
});test("should match snapshot", () => {
const data = {
id: 1,
name: "Test User",
email: "test@example.com",
};
expect(data).toMatchSnapshot();
});
test("should match inline snapshot", () => {
const config = { theme: "dark", language: "en" };
expect(config).toMatchInlineSnapshot(`
{
"theme": "dark",
"language": "en"
}
`);
});Common matchers available:
// Equality
expect(value).toBe(expected); // ===
expect(value).toEqual(expected); // Deep equality
// Truthiness
expect(value).toBeTruthy();
expect(value).toBeFalsy();
expect(value).toBeDefined();
expect(value).toBeUndefined();
// Numbers
expect(number).toBeGreaterThan(3);
expect(number).toBeLessThan(5);
// Strings
expect(string).toMatch(/pattern/);
expect(string).toContain("substring");
// Arrays
expect(array).toContain(item);
expect(array).toHaveLength(3);
// Objects
expect(object).toHaveProperty("key");
expect(object).toMatchObject({ subset });
// Promises
await expect(promise).resolves.toBe(value);
await expect(promise).rejects.toThrow();
// Mock functions
expect(mockFn).toHaveBeenCalled();
expect(mockFn).toHaveBeenCalledTimes(3);
expect(mockFn).toHaveBeenCalledWith(arg1, arg2);import { beforeAll, afterAll, beforeEach, afterEach, describe, it } from "bun:test";
describe("User service", () => {
let db: Database;
beforeAll(async () => {
// Setup before all tests
db = await connectToDatabase();
});
afterAll(async () => {
// Cleanup after all tests
await db.close();
});
beforeEach(async () => {
// Reset before each test
await db.clear();
});
it("should create user", async () => {
const user = await db.users.create({ name: "Test" });
expect(user.id).toBeDefined();
});
});View coverage report:
# Generate coverage
bun test --coverage
# View HTML report
bun test --coverage --reporter=html
open coverage/index.htmlSet coverage thresholds in bunfig.toml:
[test]
coverage = true
coverageThreshold = 80 # Fail if coverage < 80%# Run with debugger
bun test --inspect
# Verbose output
bun test --verbose
# Show all test results
bun test --reporter=tapBun test is significantly faster than Jest:
3-10x faster execution!
After basic setup:
For detailed implementations, see the reference files linked above.
© involvex, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in .agents/skills/bun-test of involvex/youtube-music-cli.
Open the folder on GitHubat commit a0d4e49
Bun Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Bun Test this skillinvolvex/youtube-music-cli | 456 | — | ~2.3k | Automated safety check: Notes | MIT | |
| Write Testsgrafana/synthetic-monitoring-app | 171 | — | ~1.2k | Automated safety check: Pass | AGPL-3.0 | |
| Write Testsopenplayerjs/openplayerjs | 649 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Test Specialisttravisjneuman/.claude | 101 | — | ~3.7k | Automated safety check: Pass | MIT | |
| Senior QAalirezarezvani/claude-skills | 28k | 1 repos | ~2.1k | Automated safety check: Pass | MIT | |
| TDD Guidealirezarezvani/claude-skills | 28k | — | ~3.4k | Automated safety check: Pass | MIT |
grafana/synthetic-monitoring-app
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.
openplayerjs/openplayerjs
Write or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and…
travisjneuman/.claude
Test-writing patterns for JS/TS, Python, Go, and Rust (unit, integration, E2E, visual regression).
alirezarezvani/claude-skills
Generates unit tests, integration tests, and E2E tests for React/Next.js applications.
alirezarezvani/claude-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
Jaganpro/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring.
involvex/youtube-music-cli
Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query.
involvex/youtube-music-cli
Win32 FFI binding lifecycle for @bun-win32/ packages (Win32 DLL bindings via bun:ffi on Windows).
involvex/youtube-music-cli
Create optimized production bundles with Bun's native bundler.
involvex/youtube-music-cli
Set up high-performance development servers with Hot Module Replacement.
involvex/youtube-music-cli
Initialize a new Bun project with TypeScript and optimal configuration.
Categories
Configure Bun's built-in test runner with Jest-compatible APIs. Bun Test is an agent skill from involvex/youtube-music-cli. Configure Bun's built-in test runner with Jest-compatible APIs.
Bun Test fits situations like: setting up testing infrastructure; writing unit/integration/snapshot tests; migrating from Jest; configuring test coverage.
Run `npx skills add involvex/youtube-music-cli --skill bun-test -a claude-code`. Or copy the skill folder (.agents/skills/bun-test in involvex/youtube-music-cli) into .claude/skills/bun-test in your project. Claude Code loads it when a task matches its description.
Run `npx skills add involvex/youtube-music-cli --skill bun-test -a codex`. Or copy the skill folder (.agents/skills/bun-test in involvex/youtube-music-cli) into .agents/skills/bun-test in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add involvex/youtube-music-cli --skill bun-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bun-test, .gemini/skills/bun-test, .github/skills/bun-test and .opencode/skills/bun-test in your project.
Going by SKILL.md and its folder, Bun Test needs the command-line tools its instructions call (bun). Its frontmatter pre-approves these tools: Bash, Write, Read. Compatibility (from SKILL.md): Requires Bun 1.0+.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Bun Test is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.9k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Bun Test: Write Tests (grafana/synthetic-monitoring-app, 171 stars), Write Tests (openplayerjs/openplayerjs, 649 stars), Test Specialist (travisjneuman/.claude, 101 stars) and Senior QA (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
involvex (a GitHub user) maintains it in involvex/youtube-music-cli, which has 456 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 6, 2026.
Source: involvex/youtube-music-cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.