Snapshot and golden-file testing: keep output stable

10 steps · about 2 h 30 min · Intermediate

  1. Golden File Testing (article, Lobsters, 8 min)

    A short plain-language summary of the record, compare and approve cycle that every snapshot tool follows.

  2. Snapshot Testing · Jest (doc, Jest official docs, 25 min)

    The official walkthrough of snapshot files, failures, the update flag and inline snapshots in the most widely used tool.

  3. Jest Snapshot Testing: Complete Guide for React Developers (article, helpmetest, 15 min)

    Adds do and don't rules and property matchers for ids and dynamic values, building on the Jest docs.

  4. Snapshot Testing with Jest: How It Works and When to Use It (article, helpmetest, 12 min)

    Covers mocking Date.now and organizing .snap files, which are the usual causes of flaky snapshots.

  5. syrupy (doc, Syrupy project docs, 25 min)

    Carries the same idea into Python with a pytest fixture, matchers, filters and JSON output.

  6. Releases · syrupy-project/syrupy (repo, GitHub, 10 min)

    Release notes show real-world edge cases such as unused snapshot cleanup and parallel pytest-xdist updates.

  7. Snapshot Testing - Rust SME Cookbook (recipes, Rust SME Cookbook, 15 min)

    Shows insta's review workflow, inline snapshots and redaction of unstable fields, a third ecosystem's take.

  8. GitHub - franiglesias/golden: Golang Library for snapshot testing (repo, GitHub (franiglesias), 15 min)

    Introduces approval testing and golden master mode in Go, for characterizing legacy code.

  9. Regression Testing Golden File Management: A Durable Workflow for Reliable Baselines (article, QASkills, 15 min)

    Helps you decide which outputs deserve a golden file and which need a direct assertion.

  10. golden-file-conventions (reference, Tessl registry (testland), 10 min)

    A checklist for naming, sanitizing, per-OS variants and reviewing snapshot diffs in PRs, to finish with.