test: isolate flaky shared-state tests

This commit is contained in:
YeonGyu-Kim
2026-04-04 19:20:40 +09:00
parent 5213525a95
commit ad025ee0f8
3 changed files with 314 additions and 237 deletions
+13 -1
View File
@@ -1,6 +1,6 @@
/// <reference types="bun-types" />
import { describe, test, expect, beforeEach, afterEach, spyOn } from "bun:test"
import { describe, test, expect, beforeEach, afterEach, spyOn, mock } from "bun:test"
import { createBuiltinAgents } from "./builtin-agents"
import type { AgentConfig } from "@opencode-ai/sdk"
import { clearSkillCache } from "../features/opencode-skill-loader/skill-content"
@@ -10,6 +10,18 @@ import * as shared from "../shared"
const TEST_DEFAULT_MODEL = "anthropic/claude-opus-4-6"
beforeEach(() => {
mock.restore()
clearSkillCache()
connectedProvidersCache._resetMemCacheForTesting()
})
afterEach(() => {
clearSkillCache()
connectedProvidersCache._resetMemCacheForTesting()
mock.restore()
})
describe("createBuiltinAgents with model overrides", () => {
test("Sisyphus with default model has thinking config when all models available", async () => {
// #given