Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(tests): pass the loader hook a URL instead of a doubled Windows path

liuzixiang4b16f28f52ea
diff --git a/apps/desktop/test/plugin-prompt-enhancement-migration.test.mjs b/apps/desktop/test/plugin-prompt-enhancement-migration.test.mjs
index 32764f637..8a717c5ac 100644
--- a/apps/desktop/test/plugin-prompt-enhancement-migration.test.mjs
+++ b/apps/desktop/test/plugin-prompt-enhancement-migration.test.mjs
@@ -4,10 +4,11 @@ import test from "node:test";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { register } from "node:module";
-import { pathToFileURL } from "node:url";
const here = new URL(".", import.meta.url);
-register(pathToFileURL(new URL("helpers/ts-import-hooks.mjs", here).pathname));
+// register() takes a URL; routing through .pathname yields /D:/... on Windows
+// and pathToFileURL then doubles the drive (file:///D:/D:/...).
+register(new URL("helpers/ts-import-hooks.mjs", here));
const { migrateLegacyPromptEnhancementSettings } = await import(
"../electron/main/plugin-prompt-enhancement-migration.ts"
);