testing-typescript
TypeScript testing with Vitest/Jest: file structure, mocking strategy, async patterns, and coverage targets
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
TypeScript testing with Vitest/Jest: file structure, mocking strategy, async patterns, and coverage targets
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Architecture decisions: layering, design patterns, microservices trade-offs, and domain-driven design
Python architecture: PEP-8, type hints, clean layering, dependency injection, and testing strategy
General code review process: priority ordering, what to block on, how to give actionable feedback
Python data science: notebook structure, data validation, reproducibility, and model documentation
Git workflow: branch naming, conventional commits, PR conventions, and merge strategies
TypeScript refactoring: SOLID principles, DRY, type safety improvements, and eliminating code smells
| name | testing-typescript |
| description | TypeScript testing with Vitest/Jest: file structure, mocking strategy, async patterns, and coverage targets |
vitest run / vitest run --coveragesrc/utils/format.ts → src/utils/format.test.tstests/fixtures/ or src/__tests__/helpers/describe('formatDate', () => {
it('should return ISO date string when given a valid Date', () => {
// Arrange
const date = new Date('2026-01-15');
// Act
const result = formatDate(date);
// Assert
expect(result).toBe('2026-01-15');
});
});
// Module mock — top of file
vi.mock('../services/emailService');
// Spy without full mock
const spy = vi.spyOn(mailer, 'send').mockResolvedValue(undefined);
// Restore after each test
afterEach(() => vi.restoreAllMocks());
// Time control
beforeEach(() => vi.useFakeTimers());
afterEach(() => vi.useRealTimers());
// Always await; use assertions count for safety
it('should reject with AuthError when token is expired', async () => {
expect.assertions(1);
await expect(verifyToken('expired')).rejects.toThrow('Token expired');
});