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
+8 -2
View File
@@ -1,4 +1,4 @@
import { describe, it, expect, spyOn, beforeEach } from "bun:test"
import { describe, it, expect, spyOn, beforeEach, afterEach } from "bun:test"
import { executeOnCompleteHook } from "./on-complete-hook"
describe("executeOnCompleteHook", () => {
@@ -9,8 +9,14 @@ describe("executeOnCompleteHook", () => {
} as unknown as ReturnType<typeof Bun.spawn>
}
let consoleErrorSpy: ReturnType<typeof spyOn<typeof console, "error">>
beforeEach(() => {
spyOn(console, "error").mockImplementation(() => {})
consoleErrorSpy = spyOn(console, "error").mockImplementation(() => {})
})
afterEach(() => {
consoleErrorSpy.mockRestore()
})
it("executes command with correct env vars", async () => {