一键导入
setup-frontend-testing
Configures the frontend testing stack for a React/Vite project (Vitest, RTL, MSW). for E2E setup, use 'setup-e2e-testing'.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Configures the frontend testing stack for a React/Vite project (Vitest, RTL, MSW). for E2E setup, use 'setup-e2e-testing'.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Provides the single source of truth for brand guidelines, design tokens, technology choices, and voice/tone. Use this skill whenever generating UI components, styling applications, writing copy, or creating user-facing assets to ensure brand consistency.
Generates high-quality, predictable, and efficient .agent/skills/ directories based on user requirements. Use this skill when the user asks to create a new skill.
Reviews code changes for bugs, style issues, and best practices. Use when reviewing PRs or checking code quality.
Generates hexagonal architecture directory structure and boilerplate code for new domains in the FastAPI backend. Use when creating a new backend module, feature, or domain.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Automates interaction with Google NotebookLM via MCP. Use this skill when the user wants to research topics, manage notebooks, generate content (audio/video overviews, reports), or query existing sources using NotebookLM.
| name | setup-frontend-testing |
| description | Configures the frontend testing stack for a React/Vite project (Vitest, RTL, MSW). for E2E setup, use 'setup-e2e-testing'. |
Install the required dev-dependencies ensuring compatibility with React 18+ and Vite.
npm install -D vitest jsdom @testing-library/react @testing-library/user-event @testing-library/jest-dom @vitest/coverage-v8 msw
Create or update the config to use jsdom and set coverage thresholds:
truejsdomsrc/test/setup.ts@testing-library/jest-dom.beforeAll(listen), afterEach(reset), afterAll(close)).ResizeObserver, matchMedia).Create the following structure to support Co-located Unit tests:
src/
├── features/
│ └── [feature]/
│ ├── components/
│ │ └── [Component].test.tsx # Unit/Component Tests
│ └── api/
│ └── mswHandlers.ts # Network Mocks for this feature
├── test/
│ ├── setup.ts # Global setup
│ └── utils.tsx # Custom render wrapper
In src/test/utils.tsx, export a render function that wraps components in:
QueryClientProvider (retry: false)MemoryRouterHelmetProvider (if used)npm run test to verify Vitest & MSW are active.testing-e2e-with-playwright skill for E2E.