✨ feat(mq-test): add snapshot testing via assert_snapshot - #2193
Merged
Conversation
Adds golden-file snapshot testing to mq-test, modeled on typst's suite/ref/store split. `assert_snapshot(name, actual)` is a new mq-test-only builtin that compares actual output against a checked-in `__snapshots__/<file>/<name>.snap`, and on mismatch writes the actual output plus a self-contained HTML diff report to `.mq-test-store/` for review. `--update-snapshots` creates or overwrites goldens from the current output.
harehare
force-pushed
the
feat/mq-test-snapshot-testing
branch
from
August 13, 2026 13:01
7836ff7 to
311462e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds golden-file snapshot testing to mq-test, modeled on typst's suite/ref/store split.
assert_snapshot(name, actual)is a new mq-test-only builtin that compares actual output against a checked-in__snapshots__/<file>/<name>.snap, and on mismatch writes the actual output plus a self-contained HTML diff report to.mq-test-store/for review.--update-snapshotscreates or overwrites goldens from the current output.Type of Change
Checklist
cargo fmtandcargo clippyand addressed any warningsjust test-alland all tests pass/docs, crateREADME.md) if neededAdditional Context