writing-tests
БесплатноБез исполняемых скриптовНе проверенGuidance for explicitly requested new tests and for updating or reviewing existing tests in the Remotion repository.
от remotion-dev★ 77 030 звёзд на GitHubОб этом скилле
Writing Tests
Apply this skill when the user explicitly requests new tests or when existing tests, fixtures, or snapshots need updates for feature work, bug fixes, refactors, or PR preparation. Do not add new tests, including new test cases in existing files, unless the user explicitly requests them. A request to review tests does not authorize changing them.
The purpose of a test is confidence that a workflow or contract works for a Studio user, CLI user, package consumer, or renderer consumer.
Test the feature at the widest stable boundary that gives useful confidence. Prefer one complete integration workflow; use focused unit tests for genuinely complex logic and E2E tests for critical cross-process workflows.
Test count, assertion count, file count, and coverage percentage are not quality metrics. One rendered frame, final artifact, or persisted-source assertion can give more confidence than many narrow unit assertions.
A test that stays green when the feature is disconnected is not useful primary coverage. For a user-facing or cross-layer feature, a private helper unit test must not be the only coverage.
Choose the boundary before writing the test
Answer these questions first:
- What failure would a user or public API consumer notice?
- What is the widest stable boundary that can reproduce it economically?
- Is there an existing integration or E2E workflow that can be extended?
- Would the proposed test fail if the feature entry point stopped calling the tested helper?
- Which edge cases, if any, still justify focused unit tests?
Test type is determined by the boundary, not the directory or runner. A Bun test can be an integration test, while a Playwright test can still be coupled to implementation details.
Use these primary boundaries:
| Change | Preferred primary coverage |
|---|---|
| Studio interaction | Playwright action followed by a visible, source-file, persistence, URL, or rendered outcome |
| Studio Server or codemod | Realistic source fixture through the route or handler, followed by the resulting source or event |
| Core, Player, or Media | Mount or render the real component with real neighboring modules and representative media |
| Web renderer or visual effect | Browser render, image comparison, pixel probe, or produced frame |
| CLI | Execute the command and assert exit code, output, and filesystem effects |
| Renderer, SSR, templates, or packaging | Public API through packages/it-tests or a realistic temporary project |
| Lambda or cloud orchestration | Full orchestration with only the remote provider mocked or faked |
| Pure math, parser, serializer, protocol transformation, or state machine | Focused, preferably table-driven unit tests |
Do not force every change through Playwright. A route-level or filesystem integration is often the best stable boundary. Reserve full E2E tests for important risks that cross browser, server, filesystem, HMR, or process boundaries.
Assert contracts and outcomes
Prefer outcomes a user or integrator can observe:
- Rendered frames, pixels, media timestamps, image output, and visual regressions
- Generated or persisted source code and files
- Public return values, events, errors, and protocol messages
- CLI exit status, output, prompts, and filesystem changes
- Studio text, accessible names, focus, enabled state, navigation, and persistence
- Requests to external boundaries, including method, path, and payload when those are the contract
Prefer a positive final outcome proving the path ran. does not throw, not visible, not present, or “error absent” is weak as the only proof. First assert the expected reorder, file mutation, request, rendered output, persisted state, or successful result; add the negative assertion only when it provides additional confidence.
When generated code is the user-visible artifact, source assertions are legitimate. Assert the meaningful output and avoid coupling to irrelevant formatting unless formatting itself is part of the contract.
Studio and product UI tests
Locate controls as users find them: getByRole, getByLabel, getByText, and accessible names. Prefer semantic stat
Установить writing-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл writing-tests?
Guidance for explicitly requested new tests and for updating or reviewing existing tests in the Remotion repository.
Как установить скилл writing-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл writing-tests запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic