fix: address cubic 4/5 review issues

- Preserve encoding/callback args in stdout.write wrapper (json-output.ts)
- Restore global console spy in afterEach (server-connection.test.ts)
- Restore console.error spy in afterEach (on-complete-hook.test.ts)
This commit is contained in:
YeonGyu-Kim
2026-02-07 17:39:16 +09:00
parent 4059d02047
commit eafcac1593
3 changed files with 17 additions and 5 deletions
+6
View File
@@ -1,5 +1,7 @@
import { describe, it, expect, mock, beforeEach, afterEach } from "bun:test"
const originalConsole = globalThis.console
const mockServerClose = mock(() => {})
const mockCreateOpencode = mock(() =>
Promise.resolve({
@@ -36,6 +38,10 @@ describe("createServerConnection", () => {
globalThis.console = { ...console, log: mockConsoleLog } as typeof console
})
afterEach(() => {
globalThis.console = originalConsole
})
it("attach mode returns client with no-op cleanup", async () => {
// given
const signal = new AbortController().signal