Skip to content

test: cover invalid index items in SitemapAndIndexStream - #523

Merged
derduher merged 1 commit into
masterfrom
claude/sitemap-issue-517-167468
Oct 19, 2026
Merged

derduher merged 1 commit into
masterfrom
claude/sitemap-issue-517-167468

Conversation

@derduher

Copy link
Copy Markdown
Collaborator

Closes #517.

The fix itself already landed in 68f6808: addToIndex reports the index item error, and the CHANGELOG already has an entry for it. That commit included a test for an invalid index URL at ErrorLevel.THROW, but not the other cases the issue asks for.

Changes

  • One table-driven test covers both rejected index items at THROW: a non-http(s) URL and an invalid lastmod.
  • Both cases now also check that the index output has no <sitemap> entry for the rejected item.
  • A new test checks that at WARN and SILENT the sitemap stays in the index without its <lastmod>, and that a warning is logged only at WARN.

Testing

  • npm test: 530 tests pass. Lint, Prettier and tsc --noEmit are clean.
  • With the error capture in addToIndex removed, both THROW tests fail.

🤖 Generated with Claude Code

The fix for #517 already landed in 68f6808 with a test for an invalid
index URL at ErrorLevel.THROW. This adds the missing cases:

- an invalid index lastmod at THROW fails the stream
- neither rejected item leaves a <sitemap> entry in the index output
- at WARN and SILENT, the sitemap stays listed without its lastmod

Closes #517

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derduher
derduher merged commit 33a1144 into master Oct 19, 2026
22 checks passed
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.

SitemapAndIndexStream ignores invalid index entries at ErrorLevel.THROW

1 participant