test: restore mocked modules in recovery-hook to prevent cross-test leakage
This commit is contained in:
parent
58b924aabe
commit
64ff0da1a2
@ -1,5 +1,8 @@
|
||||
import { beforeEach, describe, expect, mock, test } from "bun:test"
|
||||
import { afterAll, beforeEach, describe, expect, mock, test } from "bun:test"
|
||||
import type { PluginInput } from "@opencode-ai/plugin"
|
||||
import * as originalExecutor from "./executor"
|
||||
import * as originalParser from "./parser"
|
||||
import * as originalLogger from "../../shared/logger"
|
||||
|
||||
const executeCompactMock = mock(async () => {})
|
||||
const getLastAssistantMock = mock(async () => ({
|
||||
@ -24,6 +27,12 @@ mock.module("../../shared/logger", () => ({
|
||||
log: () => {},
|
||||
}))
|
||||
|
||||
afterAll(() => {
|
||||
mock.module("./executor", () => originalExecutor)
|
||||
mock.module("./parser", () => originalParser)
|
||||
mock.module("../../shared/logger", () => originalLogger)
|
||||
})
|
||||
|
||||
function createMockContext(): PluginInput {
|
||||
return {
|
||||
client: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user