test(cli): isolate module mock cleanup
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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(() => {}),
|
||||
|
||||
Reference in New Issue
Block a user