Skip to content

test(blog): add simple regression test for trailingSlash (AI-assisted)#12197

Open
04AvinashSingh wants to merge 1 commit into
facebook:mainfrom
04AvinashSingh:test/blog-trailing-slash-regression
Open

test(blog): add simple regression test for trailingSlash (AI-assisted)#12197
04AvinashSingh wants to merge 1 commit into
facebook:mainfrom
04AvinashSingh:test/blog-trailing-slash-regression

Conversation

@04AvinashSingh

Copy link
Copy Markdown

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Fixes #7656.

This PR adds a simple string match regression check to the existing test suite to verify that trailingSlash: true correctly applies to blog feeds.

This explicitly addresses the previous maintainer feedback that PR #12022 was overly complex, achieving the exact same regression coverage in just 4 lines of code without requiring dynamic XML/JSON parsing.

(AI-assisted)

Test Plan

Ran pnpm test over the entire repository. The new assertion in packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts fails loudly if applyTrailingSlash is ever accidentally removed from the feed generator logic, but passes cleanly with the current correct behavior.

Additionally, I fixed two hidden TypeScript compilation errors inside feed.test.ts (a broken DEFAULT_VCS_CONFIG import and an outdated I18nLocaleConfig mock) that were incorrectly being skipped by __tests__ exclusions in the TS config.

Test links

N/A - Unit test change only.

Related issues/PRs

Fixes #7656
Supersedes #12022

Fixes facebook#7656.

Provides a simple string match regression check to verify trailingSlash correctly applies to blog feeds, explicitly addressing previous maintainer feedback that PR facebook#12022 was overly complex.
@meta-cla

meta-cla Bot commented Jun 23, 2026

Copy link
Copy Markdown

Hi @04AvinashSingh!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 49a710a
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a3a39b60b647d00081d0ffb
😎 Deploy Preview https://deploy-preview-12197--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Jun 23, 2026
@meta-cla

meta-cla Bot commented Jun 23, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trailingSlash has no effect on URLs on blog feeds

1 participant