fix(ci): resolve mock.module() cross-file leakage in test suite

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-04 02:35:23 +09:00
parent 673b107f53
commit 6acca09bd0
15 changed files with 130 additions and 66 deletions
+3 -5
View File
@@ -1,3 +1,4 @@
import type { ModelCapabilitiesSnapshot } from "./model-capabilities"
import { afterAll, describe, expect, test, mock } from "bun:test"
// Mock connected-providers-cache to prevent local disk cache from polluting test results.
@@ -14,11 +15,8 @@ afterAll(() => {
mock.restore()
})
import {
getModelCapabilities,
getBundledModelCapabilitiesSnapshot,
type ModelCapabilitiesSnapshot,
} from "./model-capabilities"
const { getModelCapabilities, getBundledModelCapabilitiesSnapshot } = await import("./model-capabilities")
mock.restore()
import { AGENT_MODEL_REQUIREMENTS, CATEGORY_MODEL_REQUIREMENTS } from "./model-requirements"
describe("getModelCapabilities", () => {