somewhatabstract/checksync

Use jest-specific-snapshot or some other mechanism to make integration test snapshots easier to manage

Open

#2,054 opened on Mar 7, 2025

View on GitHub
 (0 comments) (0 reactions) (1 assignee)TypeScript (2 forks)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (20 stars)
PR merge metrics
 (PR metrics pending)

Description

Currently, we add all our integration test snapshots into one big file. It's getting unmanageable for code reviews when things change like we add new examples, or modify our logged output.

It would be helpful to move each snapshot to its own file. Since we autogenerate the test cases based off the examples on disk, it's not so easy to just have one test file per example, or per scenario per example - we would need to autogenerate the test files themselves. That feels messy.

Instead, if we can just override where jest writes a snapshot, then we can tidy things up. https://github.com/igor-dv/jest-specific-snapshot allows for this.

We may need to do our own snapshot deletion code if an example is deleted or something, since I'm not sure just updating snapshots will tidy-up unused snapshots written this way, but that's manageable and a better situation than the ever growing integration test snapshots file.

Contributor guide