Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

quality.testing

Snapshot assertions should name intent

Snapshot matchers without a snapshot name or preceding intent comment are hard to review in diffs.

#Metadata

Rule ID
ts.testing.no-snapshot-without-intent
Severity
low
Confidence
0.65
Languages
javascript, typescript
Presets
recommended, strict
Stability
experimental
Applies to
block
Tags
quality, rules-catalog, snapshots, testing

#Why it matters

Anonymous snapshots churn without communicating what behavior reviewers should protect.

#Remediation

Add a named snapshot, or place `// snapshot:` on the preceding line describing what the snapshot protects.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.testing.no-snapshot-without-intent.rule.yaml.