addiplus/claude-skill-pack/bun-testing
Claude Code and agent skill by addiplus/claude-skill-pack
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Run and write tests with Bun's built-in test runner. Use when user needs fast testing, Jest-compatible syntax, mocking, snapshots, or coverage. Keywords: bun test, testing, jest, vitest, mock, spy, coverage, snapshot, TDD.
Install
npx vskill@latest install addiplus/claude-skill-pack/bun-testingSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as addiplus/claude-skill-pack/bun-testing.
Bun Testing
Bun includes a blazing-fast Jest-compatible test runner. Tests run up to 100x faster than Jest.
Quick Start
Test File Conventions
Bun automatically finds test files matching:
*.test.ts,*.test.js*.spec.ts,*.spec.js- Files in
__tests__/directories
Writing Tests
Basic Test Syntax
Lifecycle Hooks
Async Tests
Matchers
Common Matchers
Async Matchers
Mocking
Mock Functions
Spying
Module Mocking
Snapshots
Coverage
Configuration
bunfig.toml
CLI Options
Workflow
Test-Driven Development
- Write failing test:
``typescript it("should add user", async () => { const user = await addUser({ name: "John" }); expect(user.id).toBeDefined(); }); ``
- Run test (fails):
``bash bun test ``
- Implement feature
- Run test (passes):
``bash bun test ``
- Refactor with confidence
CI Integration
Migration from Jest
Most Jest tests work unchanged:
Performance Tips
- Use `bun:test` imports - Native, not polyfilled
- Avoid global setup - Use
beforeAllin describe blocks - Mock I/O - Database, network, file system
- Run in parallel - Default behavior, no config needed
- Use `--bail` - Stop on first failure during development
Troubleshooting
Tests not found:
- Check file naming (.test.ts, .spec.ts)
- Check bunfig.toml include/exclude patterns
Timeout errors:
- Increase timeout:
bun test --timeout 10000 - Check for unresolved promises
Mock not working:
- Ensure
mock.module()called before import - Use
mock.module()for ESM, notjest.mock()
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/bun-testing/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/addiplus/claude-skill-pack/bun-testing)