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"
|
import * as deps from "./dependencies"
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
mock.restore()
|
||||||
|
})
|
||||||
|
|
||||||
describe("dependencies check", () => {
|
describe("dependencies check", () => {
|
||||||
describe("checkAstGrepCli", () => {
|
describe("checkAstGrepCli", () => {
|
||||||
it("returns valid dependency info", async () => {
|
it("returns valid dependency info", async () => {
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ describe("run telemetry isolation", () => {
|
|||||||
},
|
},
|
||||||
cleanup: mock(() => {}),
|
cleanup: mock(() => {}),
|
||||||
})),
|
})),
|
||||||
|
createServerConnectionWithDeps: mock(async () => ({
|
||||||
|
client: {},
|
||||||
|
cleanup: mock(() => {}),
|
||||||
|
})),
|
||||||
}))
|
}))
|
||||||
mock.module("./session-resolver", () => ({
|
mock.module("./session-resolver", () => ({
|
||||||
resolveSession: mock(async () => "ses_test"),
|
resolveSession: mock(async () => "ses_test"),
|
||||||
@@ -54,6 +58,7 @@ describe("run telemetry isolation", () => {
|
|||||||
suppressRunInput: mock(() => mock(() => {})),
|
suppressRunInput: mock(() => mock(() => {})),
|
||||||
}))
|
}))
|
||||||
mock.module("./timestamp-output", () => ({
|
mock.module("./timestamp-output", () => ({
|
||||||
|
createTimestampTransformer: mock(() => (chunk: string) => chunk),
|
||||||
createTimestampedStdoutController: mock(() => ({
|
createTimestampedStdoutController: mock(() => ({
|
||||||
enable: mock(() => {}),
|
enable: mock(() => {}),
|
||||||
restore: mock(() => {}),
|
restore: mock(() => {}),
|
||||||
|
|||||||
Reference in New Issue
Block a user