원클릭으로
write-tests
Write tests following this project's testing conventions, file patterns, and placement rules
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Write tests following this project's testing conventions, file patterns, and placement rules
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Create a changeset entry describing changes to workspace packages
Scaffold a new UI component with the correct folder structure, styles, tests, and docblocks
Scaffold a new class with the correct file structure, naming, tests, and docblocks
Scaffold a new runtime type guard with the correct naming and docblocks
Scaffold a new utility function with the correct naming, tests, and docblocks
Create a git commit following this project's commit message conventions
| name | write-tests |
| description | Write tests following this project's testing conventions, file patterns, and placement rules |
| user-invocable | false |
When writing tests in this project, follow these conventions exactly.
| Type | File pattern | Runner | Purpose |
|---|---|---|---|
| Unit | *.unit.ts / *.unit.tsx | Vitest | Isolated logic, single module |
| Integration | *.integration.ts / *.integration.tsx | Vitest | Cross-module interaction |
| Performance | *.bench.ts / *.bench.tsx | Vitest Bench | Execution speed and regression guard |
| E2E | *.e2e.ts / *.e2e.tsx | Vitest | Full application user flows |
Tests live in a specs/ folder colocated with the code they test (inside each subdirectory of a module).
src/classes/
├── MyClass.ts
└── specs/
└── MyClass.unit.ts
src/components/
└── MyComponent/
├── component.tsx
└── specs/
└── MyComponent.unit.tsx
src/services/
├── ThingService.ts
└── specs/
└── ThingService.unit.ts
parseSelector.ts → specs/parseSelector.unit.tsserializeNode.ts → specs/serializeNode.unit.tsselectors.unit.ts or serialization.unit.ts when the production code is split across multiple utility files.Use the testing/ directory within modules for shared mocks, factories, and test utilities.
src/testing/
├── mocks/
└── factories/
Performance benchmarks use Vitest's bench API. They live in specs/ alongside other tests.
src/classes/
├── MyClass.ts
└── specs/
├── MyClass.unit.ts
└── MyClass.bench.ts
Benchmarks track the execution performance of specific operations. They run across many iterations automatically and report ops/sec, helping detect performance regressions as the library evolves.
import {bench, describe} from 'vitest';
import {MyClass} from '../MyClass';
const input = generateRealisticInput(); // Setup outside bench callback
describe('MyClass', () => {
bench('processes a typical document tree', () => {
const instance = new MyClass();
instance.doWork(input);
});
bench('processes a large document tree', () => {
const instance = new MyClass();
instance.doWork(largeInput);
});
});
.bench.ts file.bench() call so setup cost is not measured.pnpm test:performancespecs/ folder with the correct suffixsrc/testing/ where appropriatepnpm run check to verify tests pass