Skip to content

fix: update BrowserBridge test broken by PR #712#714

Merged
jackwener merged 1 commit intomainfrom
fix/broken-unit-test-712
Apr 2, 2026
Merged

fix: update BrowserBridge test broken by PR #712#714
jackwener merged 1 commit intomainfrom
fix/broken-unit-test-712

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Summary

  • PR perf: reduce round-trips in browser command hot path #712 refactored _ensureDaemon to use a single fetchDaemonStatus() call instead of separate isDaemonRunning() + isExtensionConnected()
  • The test fails fast when daemon is running but extension is disconnected was still mocking the old isDaemonRunning, causing fetchDaemonStatus() to return null (no daemon) and fall through to the spawn-daemon path
  • Fix: mock fetchDaemonStatus to return { extensionConnected: false } so the test correctly exercises the "daemon running, extension missing" path

Test plan

  • npx vitest run --project unit src/browser.test.ts — all 17 tests pass
  • npx vitest run --project unit — all 483 tests pass (0 failures)

…sDaemonRunning

PR #712 refactored _ensureDaemon to use a single fetchDaemonStatus() call
instead of separate isDaemonRunning(). The test was still mocking the old
function, causing it to fall through to the spawn-daemon path and throw
the wrong error message.
@jackwener jackwener merged commit 1708626 into main Apr 2, 2026
11 checks passed
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.

1 participant