Bun Jest Migration
Step-by-step guide that moves a Jest test suite to Bun's runner, covering imports, mocks, timers, and config.
- CCM score
- 54 of 100
- skills.sh installs
- 408
- GitHub stars
- 257
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers removing Jest packages, switching the test script to
bun test, and convertingjest.config.jstobunfig.toml - Includes a Jest-to-Bun API table marking which calls are identical, which need renaming, and which need rewriting
- Maps
jest.mockhoisting tomock.modulewith dynamic-import workarounds, plus fake-timer replacements built onsetSystemTime - Designed for teams with an existing Jest suite who want to move to Bun without rewriting every test
Install
$ npx -y skills add secondsky/claude-skills --skill bun-jest-migration -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Bun Jest Migration
Bun's test runner is Jest-compatible. Most Jest tests run without changes.
Quick Migration
# 1. Remove Jest dependencies
bun remove jest ts-jest @types/jest babel-jest
# 2. Update test script
# package.json: "test": "bun test"
# 3. Run tests
bun test
Import Changes
// Before (Jest)
import { describe, it, expect, jest } from '@jest/globals';
// After (Bun) - No import needed, or explicit:
import { describe, test, expect, mock, spyOn } from "bun:test";
API Compatibility
Fully Compatible
| Jest | Bun | Notes |
|---|---|---|
describe() | describe() | Identical |
it() / test() | test() | Use test() |
expect() | expect() | Same matchers |
beforeAll/Each | beforeAll/Each | Identical |
afterAll/Each | afterAll/Each | Identical |
jest.fn() | mock() | Use mock() |
jest.spyOn() | spyOn() | Identical |
Requires Changes
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Testing & QA, Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the bun-jest-migration skill do?
It guides migration of a project from Jest to Bun's test runner, covering import changes, mock conversion, timer and snapshot handling, and config translation from jest.config.js to bunfig.toml. Most Jest tests run without changes once the imports are updated.
How do I install the bun-jest-migration skill?
Run npx -y skills add secondsky/claude-skills --skill bun-jest-migration -y in a project. After installing, the agent can walk you through removing Jest packages and switching the test script to bun test.
Which other skills sit in the Testing and QA category?
This skill is in the Testing and QA category alongside tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui. It stands apart by focusing on moving an existing Jest suite over to Bun rather than writing new tests.
Do I need Jest installed to use bun-jest-migration?
No Jest installation is needed to follow the migration steps, since the skill tells you which Jest packages to remove with bun remove. It works on a project that currently uses Jest and @types/jest with ts-jest or babel-jest.
More from secondsky/claude-skills
All 116- Bun Macros407
- Multi Ai Consultant407
- Model Deployment405
- Graphql Implementation403
- Jest Generator402
- Thesys Generative Ui393
- Nuxt Studio391
- Maz Ui390
- Woocommerce Code Review389
- Woocommerce Backend Dev388
- Woocommerce Copy Guidelines384
- Woocommerce Dev Cycle384
- Nuxt Seo345
- Tailwind V4 Shadcn8.4K
- Aceternity Ui1.7K
- Vitest Testing1.3K
- Motion1.2K
- Playwright1.1K
- Api Testing929
- Responsive Web Design731
- Zod677
- Nano Banana Prompts655
- Mobile First Design629
- Image Optimization622
Similar to Bun Jest Migration
More Testing & QAbun-test-mockingsecondsky/claude-skills430 installsJest-compatible mocking for Bun tests covering mock functions, spies, and module replacement.
vitest-testingsecondsky/claude-skills1.3K installsModern Vitest guide for TypeScript and JavaScript tests, covering unit, integration, mocking, and coverage workflows.
migrate-to-rstestrstackjs/agent-skills446 installsStep-by-step migration workflow that moves Jest, Vitest, or Playwright Test suites to Rstest with parity checks.
javascript-testing-patternswshobson/agents21.8K installsComprehensive testing guide covering Jest and Vitest setup, unit, async, and mocking patterns for JavaScript and TypeScript.
vitestantfu/skills50.1K installsVitest-based unit testing guidance covering the Jest-compatible API, mocking, coverage, and test filtering.