Bun Snapshots
Learn how to use snapshot testing in Bun to save and compare output between test runs
Install
npx skills add jarle/bun-skills --skill Bun Snapshotsgit clone --depth 1 https://github.com/jarle/bun-skills.git /tmp/bun-skills
mkdir -p ~/.claude/skills
cp -r /tmp/bun-skills/skills/bun-test-snapshots ~/.claude/skills/Bun-SnapshotsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Snapshots
> Learn how to use snapshot testing in Bun to save and compare output between test runs
Snapshot testing saves the output of a value and compares it against future test runs. This is particularly useful for UI components, complex objects, or any output that needs to remain consistent.
## Basic Snapshots
Snapshot tests are written using the `.toMatchSnapshot()` matcher:
```ts title="test.ts" icon="https://mintcdn.com/bun-1dd33a4e/nIz6GtMH5K-dfXeV/icons/typescript.svg?fit=max&auto=format&n=nIz6GtMH5K-dfXeV&q=85&s=5d73d76daf7eb7b158469d8c30d349b0" theme={"theme":{"light":"github-light","dark":"dracula"}}
import { test, expect } from "bun:test";
test("snap", () => {
expect("foo").toMatchSnapshot();
});
```
The first time this test is run, the argument to `expect` will be serialized and written to a special snapshot file in a `__snapshots__` directory alongside the test file.
### Snapshot Files
After running the test above, Bun will create:
```text title="directory structure" icon="file-directory" theme={"theme":{"light":"github-light","dark":"dracula"}}
your-project/
├── snap.test.ts
└── __snapshots__/
└── snap.test.ts.snap
```
The snapshot file contains:
```ts title="__snapshots__/snap.test.ts.snap" icon="file-code" theme={"theme":{"light":"github-light","dark":"dracula"}}
// Bun Snapshot v1, https://bun.com/docs/test/snapshots
exports[`snap 1`] = `"foo"`;
```
On future runs, the argument is compared against the snapshot on disk.Details
- Skill name
Bun Snapshots- Repository
- jarle/bun-skills
- Path
skills/bun-test-snapshots/SKILL.md- License
- MIT
- Repo updated
- 24 February 2026
FAQ
What does the Bun Snapshots skill do?
Learn how to use snapshot testing in Bun to save and compare output between test runs
How do I install the Bun Snapshots skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add jarle/bun-skills --skill Bun Snapshots. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Bun Snapshots popular?
It lives in jarle/bun-skills, which has 9 GitHub stars and 1 forks.
Related skills
Bun Archive
9jarle/bun-skills
Create and extract tar archives with Bun's fast native implementation
Bun Auto Install
9jarle/bun-skills
Bun's automatic package installation feature for standalone script execution
Bun Bun Add
9jarle/bun-skills
Add packages to your project with Bun's fast package manager
Bun Test Configuration
9jarle/bun-skills
Learn how to configure Bun test behavior using bunfig.toml and command-line options
Bun Set a Code Coverage Threshold with the Bun Test Runner
9jarle/bun-skills
Set a code coverage threshold with the Bun test runner
Bun Test Runner
9jarle/bun-skills
Bun's fast, built-in, Jest-compatible test runner with TypeScript support, lifecycle hooks, mocking, and watch mode
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.