Snapshot testing nangkep "snapshot" saka sawetara output (umume output UI component sing direnderisasi utawa struktur data) lan mbandhingake running berikute karo iku — nandhai nalika output owah. Iki berguna kanggo ndeteksi owah-owahan sing ora dikarepake, nanging duwe keterbatasan sing perlu dimangerteni.
Carane snapshot testing gumana
1. First run → the test RECORDS the output (e.g. a rendered component) as a SNAPSHOT file
2. Later runs → COMPARE the current output to the saved snapshot:
→ MATCHES → pass; DIFFERS → fail (the output changed)
3. If the change is INTENTIONAL → UPDATE the snapshot (review the diff, then accept)
(, {
tree = ().();
(tree).();
});
