testing
БесплатноБез исполняемых скриптовНе проверенUse these testing guidelines when authoring or reviewing end-to-end, integration, or unit tests (`**/*.test.ts`, `**/*.test.tsx`), e.g. Playwright, Vitest.
от quisido★ 31 звезда на GitHubОб этом скилле
Testing guidelines
Conventions
- Avoid arbitrary timeouts (
setTimeout,sleep) in tests. - Co-locate test files with the source file they cover:
foo.ts->foo.test.tsin the same directory. - Follow the Arrange-Act-Assert (AAA) pattern: set up preconditions, invoke the unit under test, then assert the outcome.
- Group related assertions under a
describeblock; useitfor individual test cases with descriptive names that read as sentences. - Keep tests deterministic: inject time (a
nowfunction) instead of reading the real clock; never depend on real network or real Cloudflare resources. - Test observable behavior (inputs -> outputs, side effects), not internal implementation details.
- Use sentence-like
itnames, e.g.it('returns the user when the ID exists'). - Use Vitest (
describe,it,expect) for all unit and integration tests.
Constraints
- Never commit
it.onlyordescribe.only; use them only temporarily during local debugging. - Never use
vi.mock. Instead, write testable code and/or use dependency injection.
Test intent by package kind
"Test observable behavior" is refined into a specific contract per package kind. The contract defines what a test is allowed to assert about; the shared test helpers exist to enforce it, so prefer them over ad-hoc setup.
- Libraries (e.g.
fmrs,use-shallow-memo,worker): assert the published contract through the package entry point (index.ts), not internal modules. Where the value proposition is a guarantee, assert that guarantee directly. For example, referential-identity hooks usetoBe(nottoEqual) across rerenders to prove memoization holds. - Applications (e.g.
saas): assert accessibility behavior (role, accessible name, keyboard interaction, and ARIA state) through thecore-testrender()API. Do not assert on DOM structure, class names, or test IDs. - Design systems (i.e.
saas/src/design-systems/): The same suite must pass against any implementation selected byVITE_TESTED_DESIGN_SYSTEM; a new design system is correct iff it passes the shared suite. See alsopackages/saas/src/design-systems/AGENTS.md. - Services (e.g.
authn,csp): drive the Worker throughTestExportedHandlerfromworker-testwith bindings mocked viacloudflare-test-utils. Assert theResponse, emitted metrics (expectMetric), and written data points (expectToHaveWrittenDataPoint). Mock every outboundfetch(an unmocked or unused mock fails the test) and injectnow; never hit real Cloudflare resources or the real clock.
Установить testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл testing?
Use these testing guidelines when authoring or reviewing end-to-end, integration, or unit tests (`**/*.test.ts`, `**/*.test.tsx`), e.g. Playwright, Vitest.
Как установить скилл testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic