test
Test
Treat tests as executable behavior contracts. Preserve the contract while allowing implementation details to change.
Workflow
1. Frame the behavior
Identify the actor, preconditions, public action, and observable outcome from the request, accepted spec, bug report, current public contract, and callers. For a regression, separate intended behavior from the current failure and name the smallest reproduction.
Resolve contradictions before writing assertions. Existing tests are evidence, not authority, when they conflict with an accepted requirement or public contract.
Completion: the intended behavior, observation point, and source of truth are explicit.
2. Discover the test environment
Inspect repository guidance, manifests, lockfiles, scripts, runner configuration, nearby tests, setup files, installed package versions or types, and CI commands. In a workspace, inspect the owning package rather than assuming the repository root owns the test command.
Determine: