Write snapshot tests
Write snapshot tests for UI components and learn when to use them vs assertion-based tests. Covers deliberate updates and unexpected diff investigation.
Preview
Copy prompt
Write snapshot tests for the following [React / Vue / Angular] components using [Jest / Vitest]: [Paste components]. For each component, capture the initial rendered output as a snapshot. Explain the appropriate use cases for snapshot tests versus behaviour-based assertions, describe how and when to deliberately update a snapshot, and outline a process for investigating unexpected snapshot diffs introduced by a code change.
More
Testing
Prompts
