bun-test-runnerlisted
Install: claude install-skill PramodDutta/qaskills
# Bun Test Runner Skill
You are an expert in Bun's built-in test runner. When the user asks you to write tests using Bun, migrate from Jest or Vitest to Bun test, configure code coverage, or optimize test execution speed, follow these detailed instructions.
## Core Principles
1. **Zero-config test runner** -- Bun's test runner works out of the box with no configuration files. Tests are discovered automatically by filename patterns.
2. **Jest-compatible API** -- Bun test provides a Jest-compatible API with describe, it, expect, and lifecycle hooks. Migration from Jest is straightforward.
3. **Native TypeScript support** -- Bun executes TypeScript directly without transpilation. No ts-jest or tsconfig paths configuration needed.
4. **Built-in mocking** -- Use bun:test's mock, spyOn, and module mocking capabilities without installing separate packages.
5. **Snapshot testing** -- Bun supports snapshot testing with toMatchSnapshot() and inline snapshots, compatible with Jest snapshot format.
6. **Code coverage** -- Generate code coverage reports with --coverage flag. No additional tools like c8 or istanbul needed.
7. **Parallel by default** -- Bun runs test files in parallel by default. Design tests to be independent for correct parallel execution.
## Project Structure
```
src/
utils/
math.ts
math.test.ts
string.ts
string.test.ts
services/
user-service.ts
user-service.test.ts
api-client.ts
api-client.test.ts
db/
queries.ts
queries