Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

snapshot-testing

/snapshot-testing

Stosuje testy snapshotowe tylko dla zserializowanego wyniku, z przeglądem każdego diffu i twardymi limitami rozmiaru snapshotów.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Stosuje testy snapshotowe tylko dla zserializowanego wyniku, z przeglądem każdego diffu i twardymi limitami rozmiaru snapshotów.

Oryginalny opis (EN)

Use snapshot tests for serialized output only, with disciplined review of every diff and hard limits on snapshot size. Use when pinning stable rendered output like markup or an API response shape.

Jak działa

  1. Method
  2. Litmus tests
  3. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 50 linii, 392 słów
Podgląd SKILL.md
---
name: snapshot-testing
description: Use snapshot tests for serialized output only, with disciplined review of every diff and hard limits on snapshot size. Use when pinning stable rendered output like markup or an API response shape.
---

# Snapshot testing

A snapshot test records a serialized output once and fails when it changes.
Used well, it pins a component's rendered markup or a response's shape
cheaply. Used badly, it becomes the worst kind of test: a giant blob nobody
reads, a diff approved with `--update` on reflex, a green check that asserts
only that today equals yesterday. The discipline is limiting what you
snapshot and treating every diff as a claim to verify.

## Method

1. **Snapshot serialized output, not behavior.** Snapshots fit stable
   serializable artifacts: rendered HTML, a JSON response, a formatter's
   output. For logic with a known expected value, write an explicit
   assertion, since a snapshot there only hides the intent.
2. **Keep each snapshot small enough to read.** Cap it at what a reviewer
   will actually scan, roughly a screen. Snapshot one component, not a whole
   page tree. A thousand-line snapshot gets rubber-stamped, which defeats the
   test.
3. **Review every diff as a real change.** A snapshot diff is the test asking
   whether you meant to change this. Read it, confirm the change is intended,
   and only then update. Update-all in a hook or CI turns the test into a
   rubber stamp.
4. **Strip nondeterminism before serializing.** Replace timestamps, UUIDs,
   and random ids with property matchers like `expect.any(String)` or stable
   fixtures. A snapshot that changes every run trains people to ignore its
   diffs.
5. **Store snapshots as reviewed source.** Commit them, read them in the pull
   request like code, and never let a snapshot land unseen. A snapshot nobody
   looked at is a recorded output, not an assertion.
6. **Prefer inline snapshots for small values.** Keep short snapshots inline
   with the test using `toMatchInlineSnapshot` so the expected output sits
   next to the code, not in a distant `.snap` file the reader never opens.

## Litmus tests

- Could a reviewer read this snapshot's diff and judge whether the change was
  intended?
- Does the snapshot exclude every value that varies between runs?
- Is anything asserted here by snapshot that a three-line explicit assertion
  would state more clearly?

## Boundaries

Snapshots pin serialized output, they do not verify logic or catch behavior a
human never reviews: for value assertions use unit-test-design, and for large
legacy outputs use golden-master with its own diff workflow. Follow the
framework's snapshot format, Jest, Vitest, or insta, over the specifics here.

Wersje

RepozytoriumWynikLicencja
Ta strona · Amey-Thakur/AI-SKILLS90MIT
jacob-balslev/skill-graph100Apache-2.0
infinum/arkive90Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki c7248543e39b (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90qa-snapshot-tests
    Pisze testy snapshot z zasadami: co zrzucać, jak drobno, jaka polityka przeglądu aktualizacji i jak zapobiegać gniciu testów.
  • 100managing-snapshot-tests
    Tworzy i waliduje migawki komponentów do testów regresji interfejsu użytkownika, w tym aktualizację snapshotów.
  • 100managing-snapshot-tests
    Tworzy i waliduje migawki komponentów do testów regresji interfejsu użytkownika, w tym aktualizację snapshotów.
  • 100sentry-snapshots-cocoa
    Konfiguruje Sentry Snapshots w projektach Apple i Cocoa: SnapshotPreviews, wysyłkę snapshotów do Sentry, GitHub Actions i selektywne testy snapshotowe.
  • 86snapshot-logic-architecture
    Opisuje i wdraża logikę LearningBus, Snapshot i Security Gate.
  • 100mobiai-ios-testing
    Pomaga pisać i uruchamiać testy w projekcie iOS: jednostkowe, interfejsu i snapshotowe, oraz dobierać odpowiedni framework.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.