From 98682472e2a4d641332d2228d31c210bcd010ae1 Mon Sep 17 00:00:00 2001 From: can1357 Date: Thu, 13 Aug 2026 17:31:44 +0200 Subject: [PATCH] test(update): initialize theme in isolated race test --- packages/coding-agent/test/update-cli.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/coding-agent/test/update-cli.test.ts b/packages/coding-agent/test/update-cli.test.ts index 3e0345a1f..c3a1e278f 100644 --- a/packages/coding-agent/test/update-cli.test.ts +++ b/packages/coding-agent/test/update-cli.test.ts @@ -34,6 +34,7 @@ import { import Update from "@oh-my-pi/pi-coding-agent/commands/update"; import { removeWithRetries } from "@oh-my-pi/pi-utils"; import type { CliConfig } from "@oh-my-pi/pi-utils/cli"; +import { getThemeByName, setThemeInstance } from "../src/modes/theme/theme"; const tempDirs: string[] = []; @@ -1110,6 +1111,9 @@ describe("update-cli concurrent binary updates", () => { // unlink deleted A's temp file, so A's chmod failed with ENOENT even though // its size + digest passed. Unique temp paths keep the two runs independent. it("lets an overlapping slow run install after a fast run completes, instead of failing chmod with ENOENT", async () => { + const loadedTheme = await getThemeByName("dark"); + if (!loadedTheme) throw new Error("theme unavailable"); + setThemeInstance(loadedTheme); vi.spyOn(console, "log").mockImplementation(() => {}); const dir = await makeTempDir(); const targetPath = path.join(dir, "omp");