test(theme): use raw string serializer for markdown snapshots - #238
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe theme snapshot test now passes an explicit identity serializer to the snapshot assertion. The expected TypeDoc output changed from an escaped single-line string to a multiline template literal. The rendered Markdown content, documented entities, annotations, examples, overloads, and types remain unchanged. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
bjohansebas
approved these changes
Aug 11, 2026
ryzrr
approved these changes
Aug 11, 2026
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
Improves Developer Experience (DX) by making generated markdown snapshots human-readable.
Details
By default, the
node:testsnapshot serializes strings by escaping\n. Because of this, the entire markdown output is compressed into a single line. When a snapshot test fails, the resulting line-diff is big and hard to read, looking like this:By overriding the default serializer with
(val) => val, we prevent this escaping behavior. The snapshots are now saved as raw multi-line strings. Now, when a test fails, the diff correctly highlights only the specific lines that changed, looking like this:Summary by CodeRabbit