Skip to content

test: use standard snapshots for generated files - #32

Merged
maxholman[bot] merged 2 commits into
masterfrom
test/standard-snapshots
Sep 27, 2026
Merged

maxholman[bot] merged 2 commits into
masterfrom
test/standard-snapshots

Conversation

@maxholman

@maxholman maxholman Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Generated files were snapshotted with toMatchFileSnapshot into __tests__/__snapshots__/<suite>/<test>/<file>.ts, through an expectGenerated helper. On #25 those folders are named <suite>.test.ts/. Tests now call expect(result.typesFile.getText()).toMatchSnapshot("types.ts") directly, so each suite gets the standard __snapshots__/<suite>.test.ts.snap, keyed <test name> > types.ts 1. Every file is still snapshotted whole.

  • expectGenerated (__tests__/generated-snapshot.ts) is deleted.
  • Each of the 50 entries is byte-identical to the file it replaces. Checked by evaluating each .snap and comparing its entries with the old files at master.
  • Removed the __snapshots__ ignores from oxfmt, oxlint, fallow and tsconfig. They only existed because generated .ts lived there.
  • just check passes.

When #25 is rebased onto this, it drops its own expectGenerated in __tests__/helpers.ts the same way.

maxholman Bot and others added 2 commits September 27, 2026 16:09
expectGenerated wrote a folder per suite and test, with a file per
generated module. It now records each file whole in the suite's
standard .snap, keyed by test name and file name. All 50 snapshots are
byte-identical to the files they replace.

With no generated .ts left under __snapshots__, oxfmt, oxlint, fallow
and tsconfig no longer need to ignore it.

Co-Authored-By: LLM <noreply@block65.dev>
The helper had become a loop around one matcher call. Each test now
snapshots its generated files itself, with the same hints, so the .snap
keys don't change.

Co-Authored-By: LLM <noreply@block65.dev>
@maxholman maxholman Bot changed the title test: snapshot generated files with toMatchSnapshot test: use standard snapshots for generated files Sep 27, 2026
@maxholman
maxholman Bot merged commit b150802 into master Sep 27, 2026
4 checks passed
@maxholman
maxholman Bot deleted the test/standard-snapshots branch September 27, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants