Our review
Generates bun:test unit tests for a TypeScript file in a Next.js project, extending an existing test file instead of overwriting it.
Strengths
- Follows project conventions: bun:test imports and co-located .test.ts/.test.tsx files next to the source
- Non-destructive: reads the existing test file and only adds missing cases (untested functions, branches, scenarios)
- Covers happy path, edge cases, and error scenarios, mocking external dependencies such as fetch, store, database calls, and crypto.randomUUID
- Adapts to the file type: API route handlers invoked directly with mock Request objects, or pure-logic and event-handling tests for React components
Limitations
- Tied to the Next.js + TypeScript + bun:test stack and not directly usable with Jest or Vitest
- Component tests depend on @testing-library/react being available and otherwise fall back to testing extracted pure logic
- Snapshot testing is excluded by design, and structural files (layout.tsx, page.tsx, globals.css) are skipped entirely
Use it when you want to quickly add or complete unit tests for a specific source file in a Next.js project running on Bun.
Avoid it on projects that do not use bun:test or Next.js, or when what you actually need is integration or end-to-end coverage.
Security analysis
SafeThe skill instructs reading source files and writing/updating co-located test files, which is a normal code-generation task. It does not involve destructive commands, network calls, exfiltration, or obfuscation, and does not require powerful tools like bash or docker.
No concerns found
Examples
/test components/IssueCard.tsx/test lib/store.ts/test app/api/issues/route.tsname: test description: Generate unit tests for a file in a Next.js TypeScript project using bun:test. Accepts a file path, reads the source, creates focused tests covering happy path, edge cases, and error scenarios. Checks for an existing test file and only adds missing tests. Follows project conventions (bun:test, co-located .test.ts/.test.tsx files).
Test Generator
Generates unit tests for Next.js TypeScript files using Bun's built-in test runner (bun:test).
Usage
/test components/IssueCard.tsx
/test lib/store.ts
/test app/api/issues/route.ts
The path is relative to the project root (no leading / needed).
Behavior
- Accepts a file path — the user provides a path to a source file (e.g.,
components/IssueCard.tsx) - Resolves the full path — joins the project root with the provided path
- Reads the source file — understands the logic, types, dependencies, and patterns
- Checks for an existing test file — looks for
{basename}.test.tsor{basename}.test.tsxnext to the source - If no test file exists — creates one with comprehensive tests
- If a test file exists — reads it, determines what's missing (untested functions, branches, scenarios), and adds only the missing test cases (never overwrites)
- Writes the test file — co-located beside the source
Test conventions
- Import from
bun:test:import { describe, it, expect, beforeEach, mock, spyOn } from "bun:test" describeblocks to group related tests- Clear test names that describe the scenario and expected outcome (e.g.,
"returns the issue when it exists") - Happy path, edge cases, and error scenarios
- Mock external dependencies:
fetch,store, database calls, Next.js response objects - Mock
crypto.randomUUID()for deterministic IDs in store tests - For React components: render with
@testing-library/reactif available, or keep tests focused on pure logic extraction and event handling - For API routes: test request/response behavior by invoking the handler directly with mock
Requestobjects - No snapshot testing
- Use
expect().toBe()/toEqual()/toThrow()/toBeNull()/toBeUndefined()
When to skip
globals.css,layout.tsx,page.tsx— these are structural bootstrapping files with little testable logicnode_modulesfiles- Test files themselves (
.test.ts/.test.tsx)
TDD Red-Green-Refactor
Testing
Skill that guides Claude through the complete TDD cycle.
Web Accessibility Audit
Testing
Performs a comprehensive web accessibility audit following WCAG standards.
UAT Test Case Generator
Testing
Generates structured and comprehensive user acceptance test cases.