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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user