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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-08 07:07:06 +09:00
parent 740d39e13a
commit 26ae247f4f
@@ -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