Repository navigation
test(sitemap): pin exact sitemap XML output (AI-assisted) - #12563
Merged
Merged
Conversation
This was referenced Oct 2, 2026
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.4 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Size Change: 0 B Total Size: 12.6 MB ℹ️ View Unchanged
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
slorber
force-pushed
the
slorber/sitemap-exact-output-tests
branch
from
October 2, 2026 09:52
2e41338 to
55d32e3
Compare
Pin the byte-exact output of sitemapItemsToXmlString() with inline snapshots for tricky inputs: namespaces, lastmod, changefreq, priority, URL escaping/normalization, one/many items, and undocumented sitemap lib fields that users can return from createSitemapItems(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
slorber
force-pushed
the
slorber/sitemap-exact-output-tests
branch
from
October 2, 2026 10:00
55d32e3 to
403d500
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.
Pre-flight checklist
Motivation
Stacked PR 2/3 to modernize
@docusaurus/plugin-sitemapXML generation without any sitemap regression. No sitemap code change: this PR only adds tests.The new tests in
xml.test.tspin the byte-exact output ofsitemapItemsToXmlString()(today'ssitemap@7output) with inline snapshots:<urlset>namespaces (news,xhtml,image,video)lastmodwithnull/'date'/'datetime': epoch 0,'',YYYY-MM-DDexpanded to a datetime, timezone offsets converted to UTC (which can shift the date)changefreqandpriority(toFixed(1)rounding,0emits0.0), and the fixed tag order&,<,>, quotes, apostrophes, spaces, CJK, accents, emoji, already percent-encoded segments, query and hash, trailing slashes, host/port/IDN, dot segments, a very long URLsitemaplib fields (links,img) that users can return fromcreateSitemapItems(), so a future custom serializer can't silently drop themNot pinned (pre-existing lib bug, out of scope): an invalid item (relative URL, invalid
lastmod) rejects cleanly only when it's the first item. At any other position, it throws an uncaught exception from the stream and the promise never settles.Test Plan
pnpm test packages/docusaurus-plugin-sitemap, fullpnpm test<url>for readability, but the helper asserts the exact header/footer, and joining the entries gives back the exact XMLTest links
Deploy preview: https://deploy-preview-12563--docusaurus-2.netlify.app/
Related issues/PRs
🤖 Generated with Claude Code