Skip to content

CodeRabbit Generated Unit Tests: Add unit tests for PR changes#147

Closed
coderabbitai[bot] wants to merge 1 commit into
mainfrom
coderabbitai/utg/cb15dc8
Closed

CodeRabbit Generated Unit Tests: Add unit tests for PR changes#147
coderabbitai[bot] wants to merge 1 commit into
mainfrom
coderabbitai/utg/cb15dc8

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Unit test generation was requested by @four-bytes-robby.

The following files were modified:

  • test/status.test.ts

Summary by cubic

Adds test/status.test.ts to validate bus reconnection behavior in status updates. The tests confirm _busPromise resets on publish failure, reconnects only when needed, handles session-scoped writes, keeps in-memory state updated even on failure, and safely handles publish-then-connect failures.

Written for commit 35f0e45. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Author

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ba96ff6-321c-4f34-829a-86657626961f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread test/status.test.ts
// status.ts tests — focused on the _busPromise reset behavior on publish failure
// ---------------------------------------------------------------------------

import { describe, test, expect, mock, beforeEach, afterEach } from "bun:test";
@four-bytes-robby

Copy link
Copy Markdown
Member

Validation: closing as not planned

CI: 2 test failuresmock.module("@four-bytes/opencode-plugin-lib") is not being hoisted correctly in CI, causing BusClient.connect() to never be called.

Line Test Expected Got
232 does NOT re-connect after a successful publish 1 0
137 re-connects on every repeated publish failure 3 2

Root cause: The mock doesn't intercept the real module import in CI's Bun version. The underlying behavior (#146_busPromise reset) is already merged to main and working.

Closing as not planned. Tests would need a different mock strategy to be CI-reliable.

@four-bytes-robby

Copy link
Copy Markdown
Member

Closing as not planned — tests fail due to mock.module() hoisting issue in CI (2/6 tests fail). Underlying fix #146 already merged. See validation comment for details.

@four-bytes-robby four-bytes-robby deleted the coderabbitai/utg/cb15dc8 branch June 15, 2026 13:15
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