test(cli): isolate module mock cleanup

This commit is contained in:
YeonGyu-Kim
2026-05-30 15:34:28 +09:00
parent dadcdbabd5
commit 381b75a60a
2 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -1,6 +1,10 @@
import { describe, it, expect, mock } from "bun:test"
import { afterEach, describe, it, expect, mock } from "bun:test"
import * as deps from "./dependencies"
afterEach(() => {
mock.restore()
})
describe("dependencies check", () => {
describe("checkAstGrepCli", () => {
it("returns valid dependency info", async () => {
+5
View File
@@ -27,6 +27,10 @@ describe("run telemetry isolation", () => {
},
cleanup: mock(() => {}),
})),
createServerConnectionWithDeps: mock(async () => ({
client: {},
cleanup: mock(() => {}),
})),
}))
mock.module("./session-resolver", () => ({
resolveSession: mock(async () => "ses_test"),
@@ -54,6 +58,7 @@ describe("run telemetry isolation", () => {
suppressRunInput: mock(() => mock(() => {})),
}))
mock.module("./timestamp-output", () => ({
createTimestampTransformer: mock(() => (chunk: string) => chunk),
createTimestampedStdoutController: mock(() => ({
enable: mock(() => {}),
restore: mock(() => {}),