Skip to main content

testing-expert

Expert in testing strategies for React, Next.js, and NestJS applications covering unit tests, integration tests, E2E tests, and testing best practices. Use when writing unit, integration, or E2E tests, testing React components, or testing API endpoints.

소스 정보

저장소
shipshitdev/shipcode
최근 소스 활동
2026년 7월 10일 11:20
감지된 SKILL.md 언어
영어
스타
6
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
3 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
testing-expert
description
Expert in testing strategies for React, Next.js, and NestJS applications covering unit tests, integration tests, E2E tests, and testing best practices. Use when writing unit, integration, or E2E tests, testing React components, or testing API endpoints.
metadata
{"version":"1.0.0","tags":"testing, quality, fullstack"}
# Testing Expert Skill ## When to Use - Writing unit tests - Creating integration tests - Setting up E2E tests - Testing React components - Testing API endpoints - Testing database operations - Setting up test infrastructure - Reviewing test coverage ## Project Context Discovery 1. **Scan Documentation:** Check `.agents/memory/` for durable project context (architecture, deployment, gotchas) 2. **Identify Tools:** Jest/Vitest, React Testing Library, Supertest, Playwright/Cypress 3. **Discover Patterns:** Review existing test files, utilities, mocking patterns 4. **Use Project-Specific Skills:** Check for `[project]-testing-expert` skill ## Core Testing Principles ### Testing Pyramid - **Unit Tests** (70%): Fast, isolated, test individual functions/components - **Integration Tests** (20%): Test component interactions - **E2E Tests** (10%): Test full user flows ### Coverage Targets - Line coverage: > 80% - Branch coverage: > 75% - Function coverage: > 85% - Critical paths: 100% ### Test Organization ``` src/ users/ users.controller.ts users.controller.spec.ts # Unit tests users.service.ts users.service.spec.ts __tests__/ integration/ e2e/ ``` ### Test Quality (AAA Pattern) ```typescript it('should return users filtered by organization', async () => { // Arrange: Set up test data const organizationId = 'org1'; const expectedUsers = [{ organization: organizationId }]; // Act: Execute the code being tested const result = await service.findAll(organizationId); // Assert: Verify the result expect(result).toEqual(expectedUsers); }); ``` ## Good Tests Are - Independent (no test dependencies) - Fast (< 100ms each) - Repeatable (same result every time) - Meaningful (test real behavior) - Maintainable (easy to update) ## Testing Best Practices Summary 1. **Test Isolation:** Each test independent, clean up after 2. **Meaningful Tests:** Test behavior, not implementation 3. **Mocking Strategy:** Mock external dependencies, not what you're testing 4. **Test Data:** Use factories, keep data minimal, clean up 5. **Coverage:** High coverage, focus on critical paths ## Integration | Test Type | Tools | Use Case | |-----------|-------|----------| | Unit | Jest/Vitest | Functions, components, services | | Integration | Supertest + Jest | Controller + Service + DB | | E2E | Playwright/Cypress | Full user flows | | Component | React Testing Library | React component behavior | --- **For complete React Testing Library examples, hook testing, Next.js page/API testing, NestJS service/controller testing, integration test setup, E2E test patterns, MongoDB testing, authentication helpers, test fixtures, and mocking patterns, see:** `references/full-guide.md`
GitHub에서 보기