CodeRabbit Generated Unit Tests: Add unit tests for PR changes#147
CodeRabbit Generated Unit Tests: Add unit tests for PR changes#147coderabbitai[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedThis 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
| // status.ts tests — focused on the _busPromise reset behavior on publish failure | ||
| // --------------------------------------------------------------------------- | ||
|
|
||
| import { describe, test, expect, mock, beforeEach, afterEach } from "bun:test"; |
Validation: closing as not plannedCI: 2 test failures —
Root cause: The mock doesn't intercept the real module import in CI's Bun version. The underlying behavior (#146 — Closing as not planned. Tests would need a different mock strategy to be CI-reliable. |
|
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. |
Unit test generation was requested by @four-bytes-robby.
The following files were modified:
test/status.test.tsSummary by cubic
Adds
test/status.test.tsto validate bus reconnection behavior in status updates. The tests confirm_busPromiseresets 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.