Skip to main content

testing-guide

VibeCode test conventions, Jest configuration, mock patterns, and known issues. Preload into test-fixer and quality-sweep agents.

설치로 이동

소스 정보

저장소
ryanmaclean/vibecode-webgui
최근 소스 활동
2026년 2월 13일 19:57
감지된 SKILL.md 언어
영어
스타
1
포크
0

설치 방법

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

소스 파일 검토

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

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
testing-guide
description
VibeCode test conventions, Jest configuration, mock patterns, and known issues. Preload into test-fixer and quality-sweep agents.
disable-model-invocation
true
user-invocable
false
# VibeCode Testing Guide ## Framework - Jest with ts-jest transform - Test files: `*.test.ts`, `*.test.tsx` - Locations: `tests/unit/`, `tests/integration/`, `tests/` ## Running Tests ```bash # Full suite (ALWAYS use --maxWorkers=2) npx jest --maxWorkers=2 --passWithNoTests # Single file npx jest --maxWorkers=2 path/to/file.test.ts # With coverage npx jest --maxWorkers=2 --coverage # Pattern match npx jest --maxWorkers=2 --testPathPattern="auth" ``` ## Test Patterns ```typescript import { describe, it, expect, jest, beforeEach } from '@jest/globals'; describe('ModuleName', () => { beforeEach(() => { jest.clearAllMocks(); }); describe('functionName', () => { it('should handle normal input correctly', () => { // arrange, act, assert }); it('should throw on invalid input', () => { expect(() => fn(null)).toThrow(); }); }); }); ``` ## Mock Patterns - Mock next-auth: `jest.mock('next-auth', () => ({ getServerSession: jest.fn() }))` - Mock prisma: `jest.mock('@/lib/prisma', () => ({ prisma: { user: { findUnique: jest.fn() } } }))` - Mock env vars: `process.env.X = 'value'` in beforeEach, cleanup in afterEach - Mock fetch: `global.fetch = jest.fn().mockResolvedValue({ json: () => ({}) })` ## Known Pre-Existing Failures (do NOT fix, do NOT block on) - `tests/feature-audit/issue-1527.test.ts` - `tests/unit/components/AppNavigation.test.tsx` - `tests/unit/lib/auth-password.test.ts` (2 failures) - Several page-level tests with route-metrics issues ## Critical Rules - NEVER use `--maxWorkers` > 2 (OOM, exit 137) - NEVER delete tests to make suite pass - After deleting source files, grep for orphaned test imports - Mock external dependencies, never make real API/DB calls
GitHub에서 보기