Repository navigation
Accept jsdom 31's serializations in two DOM tests - #309
Merged
Merged
Conversation
jsdom 31 (dependabot #307) changes two serializations the tests pinned: cssstyle now writes translate(0px, 0px) as translate(0px), and the HTML serializer now escapes < and > inside attribute values. Both are equivalent to the old spelling. Normalize them in the assertions so the tests pass on jsdom 30 and 31 alike, and #307's build goes green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F6vooF9c5HQcwhoKCDMHrc
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.
Unblocks #307 (jsdom 30.1.3 → 31.0.0), whose
buildjob fails 7 tests in two files. Both failures come from jsdom 31 changing how it serializes, not from a product change:mermaid-viewer.test.ts(6 tests): jsdom 31's cssstyle writestranslate(0px, 0px) scale(1.5)astranslate(0px) scale(1.5). The tests now read the transform through a smalltransformOf()helper that spells a one-argumenttranslate(x)astranslate(x, 0px). Every non-zero offset assertion is unchanged.table-wrapper.test.ts(1 test): the output goes back through the DOM sanitizer, and jsdom 31's serializer now escapes</>inside attribute values (<b>), as current browsers do. The string assertion accepts either spelling. The existing check that the label parses back toTableau "<b>" & coand never forms markup still pins the safety property.Test-only, no source change.
Validation
npm test, 1462 passed, 0 failed.Once this lands, #307 needs a rebase (
·@·d·ependabot r·ebase) to pick it up.Generated by Claude Code