From aa59e70660bee5ef9bd4b5ba1c057d0053d1bbee Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Wed, 6 May 2026 09:21:45 +0200 Subject: [PATCH] test(cli): fix TUI sync provider setup --- packages/opencode/test/cli/cmd/tui/sync.test.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/opencode/test/cli/cmd/tui/sync.test.tsx b/packages/opencode/test/cli/cmd/tui/sync.test.tsx index 993484d3cac..0c9d91a0725 100644 --- a/packages/opencode/test/cli/cmd/tui/sync.test.tsx +++ b/packages/opencode/test/cli/cmd/tui/sync.test.tsx @@ -9,6 +9,8 @@ import { KVProvider, useKV } from "../../../../src/cli/cmd/tui/context/kv" import { ProjectProvider } from "../../../../src/cli/cmd/tui/context/project" import { SDKProvider, type EventSource } from "../../../../src/cli/cmd/tui/context/sdk" import { SyncProvider, useSync } from "../../../../src/cli/cmd/tui/context/sync" +import { ToastProvider } from "../../../../src/cli/cmd/tui/ui/toast" // kilocode_change +import { Instance } from "../../../../src/project/instance" // kilocode_change import { tmpdir } from "../../../fixture/fixture" const worktree = "/tmp/opencode" @@ -89,6 +91,9 @@ async function mount() { + {/* kilocode_change start */} + + {/* kilocode_change end */} @@ -102,6 +107,9 @@ async function mount() { + {/* kilocode_change start */} + + {/* kilocode_change end */} @@ -129,7 +137,7 @@ describe("tui sync", () => { await using tmp = await tmpdir() Global.Path.state = tmp.path await Bun.write(`${tmp.path}/kv.json`, "{}") - const { app, kv, sync, session } = await mount() + const { app, kv, sync, session } = await Instance.provide({ directory: tmp.path, fn: mount }) // kilocode_change try { expect(kv.get("session_directory_filter_enabled", true)).toBe(true) @@ -143,6 +151,7 @@ describe("tui sync", () => { expect(session.at(-1)?.searchParams.get("path")).toBeNull() } finally { app.renderer.destroy() + await Instance.disposeAll() // kilocode_change Global.Path.state = previous } })