[Remove] test-only external URL predicate - #436
Conversation
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
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 |
|
@coderabbitai review |
|
Why
isAllowedExternalUrl()only restated whethernormalizeExternalUrl()returned a value and existed solely for tests. Keeping that duplicate API made the tests assert an implementation wrapper instead of URL normalization behavior.What changes
Remove the test-only predicate from
src/external-url.js. The former tests now assertnormalizeExternalUrl()'s returned normalized URL or refusal directly, while existing opening coverage remains intact.How to test this
Platforms: any — this is a pure URL-normalization module with no platform-specific branch.
Starting state:
node --test tests/unit/external-url.test.cjs.Expected result: the focused suite passes, including parsed-scheme normalization and refused
file:URLs.What must not have happened: invalid or non-HTTP(S) input must not reach the
openExternalrecorder; normalized HTTP(S) URLs must still be the values handed to it.No visible UI surface changed; the focused test command demonstrates this internal cleanup.
Risks and limitations
The removed export was intentionally test-only; a downstream consumer importing it would now fail, but repository-wide search found none. Self-review: 0 findings across the five required dimensions.
Related
Fixes #428.
Design decisions and alternatives considered
The assertions were folded into direct normalization checks rather than deleted wholesale, retaining coverage of the parser-derived protocol and output that callers actually use.
Review outcome (required — see AGENTS.md)
0 [fix here] · 0 [follow-up] — no findings across architecture, security, performance, cross-platform behavior, or tests.
Implementation notes
Validation:
node --test tests/unit/external-url.test.cjs(11 passing),npm run lint, andnpm test(1,258 passing). The unrelated pre-existingpackage-lock.jsonmodification was left uncommitted.