Skip to content

test(web): drop the unjustified double cast in storage-browser.test.ts - #2584

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/chore/2538-storage-browser-double-cast
Oct 5, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/chore/2538-storage-browser-double-cast

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2538

Replaces the unjustified as unknown as OAuthTokens on the partial token fixture in clients/web/src/test/core/auth/storage-browser.test.ts with a single as OAuthTokens. The literal (refresh_token + token_type) is a subset of OAuthTokens, so the single cast type-checks and no justification comment is needed.

Verification

  • tsc -p tsconfig.test.json --noEmit (web) is clean, and storage-browser.test.ts passes (42/42).
  • npm run local:gate: every stage was green except the web integration project, where 19 tests in 3 files failed for sandbox reasons unrelated to this diff:
    • 18 in transport.test.ts / server-extra-coverage.test.ts fail with Proxy response (502) ... HTTP Tunneling. The sandbox exports HTTP_PROXY, and with the proxy variables unset all 18 pass.
    • 1 in secret-store-selection.test.ts (isOnMountPoint > "is false when the path itself can't be resolved") fails because the sandbox's cwd is a bind mount, so the lexical walk to . correctly lands on a mount point.

🤖 Generated with Claude Code

The partial token fixture is a subset of OAuthTokens, so a single
'as OAuthTokens' type-checks; the 'as unknown as' carried no reason.

Closes #2538

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 5, 2026
@cliffhall cliffhall linked an issue Oct 5, 2026 that may be closed by this pull request
@cliffhall
cliffhall requested a balanced review from Copilot October 5, 2026 07:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The narrow, type-only change satisfies the linked issue and introduces no blocking concerns.

Review effort: Balanced
Findings: None

What changed in this PR

Simplifies a web OAuth test fixture’s type assertion, resolving #2538 without changing runtime behavior.

Changes:

  • Replaces as unknown as OAuthTokens with a single as OAuthTokens.
File Description
clients/​web/​src/​test/​core/​auth/​storage-browser.test.ts Removes the unnecessary double assertion from the partial token fixture.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 came back clean (no inline comments, "Findings: None", no suppressed comments), which is a stop condition. No further rounds requested.

@cliffhall
cliffhall merged commit b157763 into v2/main Oct 5, 2026
6 checks passed
@cliffhall
cliffhall deleted the v2/chore/2538-storage-browser-double-cast branch October 5, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unjustified 'as unknown as OAuthTokens' in storage-browser.test.ts

2 participants