writing-cli-e2e-tests
Installation
SKILL.md
Writing CLI E2E Tests
Overview
E2e tests run real CLI commands against real infrastructure with real side effects. They validate that commands work end-to-end for both humans (interactive) and agents/CI (non-interactive). This skill defines the philosophy and patterns for writing effective e2e tests in packages/@sanity/cli-e2e/.
For local setup, CI behavior, and how to add new env vars, see packages/@sanity/cli-e2e/README.md.
When to Use
- Adding e2e test coverage for a new CLI command
- Adding tests for new flags or flows on an existing command
- Modifying CLI behavior that needs e2e validation
Discovery & Planning
Before writing any tests, read the command source code and present a plan for user approval.