[Refactor] centralize safe log formatter tests, Fixes #429 - #440
Open
juanmaguitar wants to merge 1 commit into
Open
[Refactor] centralize safe log formatter tests, Fixes #429#440juanmaguitar wants to merge 1 commit into
juanmaguitar wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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.
Why
external-urlduplicated formatter-only coverage throughdescribeRefusedUrl(), even though the sharedsafe-logmodule owns the one-line, bounded rendering contract.What changes
Removes the forwarding export and calls
describeRefused()directly at the URL refusal boundary. Formatter coverage now exercisessafe-logdirectly;external-urlretains URL normalization and refusal-behavior coverage.How to test this
Platforms: any — this is a unit-test-only refactor with no visible UI change.
Starting state:
Check out this branch on top of
juanmaguitar/cleanup-428.Install the repository dependencies.
Run
node --test tests/unit/external-url.test.cjs tests/unit/safe-log.test.cjs.Run
npm run lintandnpm test.What must not have happened:
Refused
file:, custom, malformed, and otherwise non-HTTP(S) URLs must still not reachshell.openExternal; refused values must remain one-line and bounded. The focused tests cover this directly, and the full suite covers the integration boundary.Risks and limitations
No user-visible behavior changed. This PR is stacked on #428 and must merge after it; the review found 0 [fix here] and 0 [follow-up] findings.
Related
Fixes #429
Design decisions and alternatives considered
The formatter belongs to
safe-log, where it is shared by URL, site, and editor refusal paths. Keeping a URL-specific wrapper would preserve a second public surface without adding behavior.Review outcome (required — see AGENTS.md)
0 [fix here] · 0 [follow-up] — no findings across architecture, security, performance, cross-platform, or tests.
npm run lintandnpm testpassed (1,258 tests).Implementation notes
The branch base is
juanmaguitar/cleanup-428so #428 owns removal of the test-only external URL predicate. This change only centralizes the safe-log formatter tests and removes the forwarding alias.