Skip to content

test: organize Bitwarden URI matching cases without changing discovery - #1597

Merged
risu729 merged 5 commits into
mainfrom
claude/project-thread-ei232v
Nov 12, 2026
Merged

risu729 merged 5 commits into
mainfrom
claude/project-thread-ei232v

Conversation

@risu729

@risu729 risu729 commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Replaces #1587 and keeps its commit, plus review fixes.

Summary

  • packages/bitwarden/src/uri.test.ts keeps the seven describe scopes and the shared target, saved, emptyResult and userDomains helpers. Synchronous registrar modules in packages/bitwarden/test/uri/ hold the ordinary semantics, equivalent domain, retained context, strict admission, caller-answered Regex, destination grant and authenticated SDK cases.
  • The uri.test.ts max-lines exemption is removed from .oxlintrc.json (the largest module is 462 lines).

Review fixes on top of #1587

  • The single bindings object, which passed vitest, the sdk namespace, production exports and fixture values to every module, is gone. The modules import those directly, and the entry passes each registrar only the shared helpers it uses. The two registrars that use none take no argument.
  • The entry exports UriTestFixtures for the four helpers, and test/uri/context.ts builds the module contexts from it. The UriMatchContext re-export is gone; the Regex module imports BitwardenUriMatchContext from src/uri.
  • Each registrar has its own *-cases.ts module (ordinary-semantics-cases.ts, equivalent-domain-cases.ts, retained-context-cases.ts, strict-admission-cases.ts, regex-answer-cases.ts, destination-grant-cases.ts, authenticated-sdk-cases.ts), so regex.ts and integration.ts no longer read like production files or a test tier.
  • The stray blank line in the entry's imports is gone.
  • The docs section now sits after the sibling test organization sections and describes the layout rather than the change. It scopes the entry to the matcher's unit cases (the account and crypto Worker suites also cover matching), says the entry owns only the four helpers, and says the modules are not discovered.
  • Merged main. The .oxlintrc.json conflict with test: organize Bitwarden account mapping cases without changing discovery #1594 is resolved by dropping both removed lines, and the docs conflict by keeping every main section and adding this one before "Login wire contracts".

Verification

  • Vitest JSON reporter test IDs for src/uri.test.ts: 207, identical to main and all passing.
  • oxfmt --check, oxlint packages/bitwarden, rumdl check docs/development.md, mise run //packages/bitwarden:typecheck pass.

Generated by Claude Code

risu729 and others added 5 commits November 12, 2026 22:51
Pass only the shared target and result helpers to the URI case modules,
import vitest, production and fixture values in the modules, give each
registrar its own *-cases.ts module with contexts in context.ts, and
drop the docs section ahead of its rewrite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011PUTx3w1HVYZp73fQasU3g
# Conflicts:
#	.oxlintrc.json
#	docs/development.md
@risu729 risu729 self-assigned this Nov 12, 2026
@risu729
risu729 merged commit c60192e into main Nov 12, 2026
23 of 25 checks passed
@risu729
risu729 deleted the claude/project-thread-ei232v branch November 12, 2026 14:41
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.

2 participants