Skip to content

test(link): spread the real client connect module in the connect-recovery mock - #8699

Closed
lidge-jun wants to merge 1 commit into
devfrom
fix/dev-red4-connect-recovery-mock
Closed

lidge-jun wants to merge 1 commit into
devfrom
fix/dev-red4-connect-recovery-mock

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

test 5/5 of dev batch run 43451726885 (job), which the release is waiting on, failed both CLI cases of tests/clients/route-intent-connect-recovery.test.ts (:43 "Hub rejects generic clients before reading a credential or attempting connect", :56 "Link accepts generic clients and completion uses the effective connection selection"). The child exited 1 with:

SyntaxError: Export named 'assertDisconnectExpectation' not found in module '…/src/client/connect.ts'.

The cases came with #8416 (f23910ab2d). Their child script replaced src/client/connect with a fixed four-function object. #8662 (63c7da75bb) made src/cli/connect.ts also import assertDisconnectExpectation from that module, so the mocked module no longer satisfied the CLI's imports. Product code is correct; the mock was closed over an export list.

The mock now spreads the real module and fakes only the four connection actions it faked before, so exports the CLI adds later still link. No assertion changed. No other test mocks this module.

Verification

  • Reproduced on dev 65ec0dd22e: bun test tests/clients/route-intent-connect-recovery.test.ts gives both cases failing with the same SyntaxError. With this change: 9 pass, 0 fail.
  • bun run typecheck: exit 0.
  • NOT RUN: the full suite.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Updated connection recovery test setup to use a more representative client configuration while preserving the targeted connection mock. This keeps the tests aligned with the client’s available behavior and supports clearer validation of connection recovery.

…very mock

test 5/5 of dev batch 43451726885 failed both CLI cases of tests/clients/route-intent-connect-recovery.test.ts: the child script replaced src/client/connect with a fixed four-function object, and since #8662 src/cli/connect.ts also imports assertDisconnectExpectation from it, so the mocked module failed to link (SyntaxError: Export named 'assertDisconnectExpectation' not found). Spread the real module and fake only the connection actions; 0/2 -> 9/9 in the file.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 15:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T15:35:12.238427Z ea803fb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The connect recovery test now imports the real connect module and preserves its exports in the mock. The mock overrides only connectClient.

Changes: Connect recovery test

Layer / File(s) Summary
Preserve connect-module exports
tests/clients/route-intent-connect-recovery.test.ts
The mock now spreads the real connect module’s exports and overrides only connectClient.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Merge Risk: Minimal · up to ea803

This change only updates a test mock so it keeps the real module's exports. It has no runtime or production impact, and I found no merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the connect-recovery test mock now spreads the real src/client/connect module instead of exporting a fixed list. It is specific and matches the summary and objectives.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the connect-recovery test mock now spreads the real src/client/connect module instead of exporting a fixed list. It is specific and matches the summary and objectives. The title says 'test(link)' rather than naming the test file, but the scope is still clear.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 65ec0dd and ea803fb.

Files selected for processing: 1

  • tests/clients/route-intent-connect-recovery.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Closing as a duplicate: #8700 (already merged) applies the same fix to tests/clients/route-intent-connect-recovery.test.ts, spreading the real client connect module in the mock, and its owner asked this lane not to touch that file.

@lidge-jun lidge-jun closed this Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant