snapshot-testing

Capture known-good outputs and compares them to detect structural regressions.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/jacob-balslev/skill-graph --skill snapshot-testing-jacob-balslev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: snapshot-testing
Source: https://github.com/jacob-balslev/skill-graph/tree/main/marketplace/skills/snapshot-testing
Command: npx skills add https://github.com/jacob-balslev/skill-graph --skill snapshot-testing-jacob-balslev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you manage structural regression risk by capturing known-good outputs as snapshots and comparing them on future runs, so meaningful changes are reviewed while unintended changes fail clearly.

Core Features & Use Cases

  • Snapshot technique selection: Distinguishes data, DOM, and visual snapshot use so you pick the right kind of capture for the output you are protecting.
  • Approval-cycle discipline: Enforces the human-reviewed baseline update pattern rather than treating failures as maintenance noise.
  • Failure-mode diagnosis: Guides you to recognize churn from instability, oversized snapshots that hide diffs, and accidental auto-accept behaviors.
  • Fit and boundary rules: Clarifies where snapshot testing belongs (structural drift) and where it does not (behavioral value assertions, universal properties, test doubles, and e2e journeys).
  • Visual regression alignment: Connects the technique to visual regression tooling patterns like Chromatic/Percy/Loki/Playwright screenshots.

Quick Start

Use snapshot-testing to decide whether a complex rendered output should be captured as a baseline snapshot with a deliberate approval cycle rather than specified via example assertions.

Frequently Asked Questions about snapshot-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is snapshot testing and when should I use it?

Snapshot testing captures known-good output artifacts and compares them against fresh output to detect structural regressions. It fits unit or integration-level verification of complex outputs across data, DOM, and visual targets.

How do I update golden files without introducing regressions?

Update golden files using an approval cycle that enforces human-reviewed baseline updates. This prevents treating failures as maintenance noise and ensures meaningful changes are reviewed while unintended changes fail clearly.

Should I use snapshot testing for end-to-end journeys or behavioral assertions?

No, snapshot testing is not suited for behavioral value contracts, universal property claims, test doubles, or end-to-end journeys. It belongs specifically in structural drift detection for complex rendered outputs.

What causes snapshot tests to churn and how do I fix it?

Churn in snapshot tests comes from instability, oversized snapshots that hide diffs, and accidental auto-accept behaviors. Fix it by applying stability controls and explicit boundaries to reduce flaky comparisons.

Can I use snapshot testing for visual regression workflows?

Yes, snapshot testing aligns with visual regression tooling patterns like Chromatic, Percy, Loki, and Playwright screenshots to capture complex rendered outputs and detect structural drift.

What is the difference between snapshot testing and approval testing?

Snapshot testing and approval testing both use golden files to capture known-good output, but snapshot testing specifically enforces a disciplined diff review with an approval cycle rather than auto-accepting failures.