Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThe changes extend npm.js URL redirect functionality by introducing a Set of multiple npmjs-related hostnames and updating the redirect logic to perform membership checks against this Set instead of direct host comparison. Additional unit tests verify that both Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/unit/server/utils/readme.spec.ts (1)
345-357: Consider adding a reserved-path exclusion test fornpmjs.org.The existing suite already verifies that
https://www.npmjs.com/productsis not redirected (line 338–343). There is no symmetrical assertion for the new.orgTLD. SinceisNpmJsUrlThatCanBeRedirectednow admits both domains through the same path, a mirrored test would guard against any future regression where the exclusion is accidentally scoped only to.com.✅ Suggested additional test
it('redirects npmjs.org urls to local (no www and http)', async () => { const markdown = `[Some npmjs.org link](http://npmjs.org/package/test-pkg)` const result = await renderReadmeHtml(markdown, 'test-pkg') expect(result.html).toContain('href="/package/test-pkg"') }) + + it('does not redirect npmjs.org to local if they are in the list of exceptions', async () => { + const markdown = `[Some npmjs.org link](https://www.npmjs.org/products)` + const result = await renderReadmeHtml(markdown, 'test-pkg') + + expect(result.html).toContain('href="https://www.npmjs.org/products"') + }) })
🔗 Linked issue
fixes: #1521
📚 Description
Rewrite to npmjs.org url to npmx relative path. currently we only have npmjs.com links handled
(Before and After)
Screen.Recording.mov