From 26ae247f4f21d3c53db1424804c04342fc29de84 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 8 Mar 2026 07:07:06 +0900 Subject: [PATCH] test(doctor): isolate loaded version module import Load the doctor loaded-version module through a unique test-only specifier so Bun module mocks from system tests cannot leak into the real module assertions in CI. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/cli/doctor/checks/system-loaded-version.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli/doctor/checks/system-loaded-version.test.ts b/src/cli/doctor/checks/system-loaded-version.test.ts index c75b7e920..3a89ee82d 100644 --- a/src/cli/doctor/checks/system-loaded-version.test.ts +++ b/src/cli/doctor/checks/system-loaded-version.test.ts @@ -4,7 +4,11 @@ import { tmpdir } from "node:os" import { dirname, join } from "node:path" import { PACKAGE_NAME } from "../constants" -import { getLoadedPluginVersion, getSuggestedInstallTag } from "./system-loaded-version" + +const systemLoadedVersionModulePath = "./system-loaded-version?system-loaded-version-test" + +const { getLoadedPluginVersion, getSuggestedInstallTag }: typeof import("./system-loaded-version") = + await import(systemLoadedVersionModulePath) const originalOpencodeConfigDir = process.env.OPENCODE_CONFIG_DIR const originalXdgCacheHome = process.env.XDG_CACHE_HOME