- name
SKILL.md
O arquivo da skill permanece no repositório do publicador.
Cole o comando copiado em um terminal. Ele instala este SKILL.md nesse agente.
npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-testing -a cursor -yCole o comando copiado em um terminal. Ele instala este SKILL.md nesse agente.
npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-testing -a claude-code -yCole o comando copiado em um terminal. Ele instala este SKILL.md nesse agente.
npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-testing -a codex -yCole o comando copiado em um terminal. Ele instala este SKILL.md nesse agente.
npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-testing -a grok -yEnvie a mensagem copiada em um chat do Grok Bot. O Bot busca este SKILL.md no GitHub e o adiciona às skills que todos os seus Bots compartilham.
Install this skill: https://github.com/shinpr/ai-coding-project-boilerplate/tree/HEAD/.claude/skills-en/frontend-typescript-testingDo publicador
Inspect package.json, the lockfile, test configuration, and existing test imports before selecting a framework or command. Apply Vitest, React Testing Library, MSW, or Playwright rules only when the dependency/configuration is present. Use the repository's configured equivalent when different. If no runnable harness can be identified, report the inspected paths and the missing framework or command instead of inventing one.
import { describe, it, expect, beforeEach, vi } from 'vitest'import { render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'vi.mock()For shared components, custom hooks, and utilities reused across features, cover their public branches, error states, and boundary contracts because their regression blast radius is wider. Verify page-level composition through integration/E2E tests when the behavior depends on multiple rendered units.
Unit Tests (React Testing Library)
Integration Tests (React Testing Library + MSW)
Cross-functional Verification
{ComponentName}.test.tsx{FeatureName}.integration.test.tsxKeep every committed test active. Repair a test that protects current behavior. Remove a test when its behavior is no longer required and the source requirement or implementation contract confirms the removal, or when another retained test fails for every regression the removed test detects.
Constrain an MSW handler's response body with satisfies against the domain type it stands for, so a fixture that drifts from the contract fails at compile time rather than producing a passing test against a shape the app never receives.
Type a component or dependency mock to the surface the subject under test actually consumes — Pick<Props, 'usedProp'>, Pick<Router, 'push'> — rather than the full interface, and constrain the literal with satisfies so an extra or misnamed member fails at compile time.
Test user-visible results, not implementation details. Query by the role and accessible name the user perceives (getByRole/getByLabelText/getByText), not getByTestId or container.querySelector. Drive interactions through userEvent with userEvent.setup() per test rather than firing raw events, so the test reproduces the browser's event sequence. await every interaction and async assertion — an unawaited interaction asserts against the pre-update render, so use findBy* for async UI.
Cover the empty, error, and loading/async states that the component renders or the accepted behavior defines, not only the happy path. Produce an error state by overriding the MSW handler for that single test rather than changing the shared handler set.
When the required UI state, accessibility name, or external contract is unknown, stop test design for that assertion and name the UI Spec, acceptance criterion, implementation contract, or user decision needed. Continue with independent assertions whose expected behavior is observed.
Designs frontend tests using the repository's configured React test and browser harnesses, including RTL, MSW, Vitest, and Playwright when present. Use when adding or reviewing component, loading/erro
---name: frontend-typescript-testingdescription: Designs frontend tests using the repository's configured React test and browser harnesses, including RTL, MSW…---# .claude/skills-en/frontend-typescript-testing/SKILL.mdVisão geral
Designs frontend tests using the repository's configured React test and browser harnesses, including RTL, MSW, Vitest, and Playwright when present. Use when adding or reviewing component, loading/error-state, integration, or frontend E2E tests.
Perguntas frequentes
Baixe .claude/skills-en/frontend-typescript-testing/SKILL.md do publicador ou copie o caminho e abra o repositório. O PlugMCP lista a skill e não hospeda o arquivo.
O publicador o mantém em https://github.com/shinpr/ai-coding-project-boilerplate.
Claude, Cursor, Codex e Grok Build conseguem ler um SKILL.md que você adiciona a partir do repositório do publicador. O Grok Bot o instala quando você envia em um chat o link da pasta da skill no GitHub.