Repository navigation
fix(tests): run the prompt-enhancement migration suite on Windows too - #2517
Conversation
plugin-prompt-enhancement-migration.test.mjs registered the TypeScript loader by routing the hook URL through .pathname and pathToFileURL. The pathname is /D:/... on Windows, so pathToFileURL doubled the drive (file:///D:/D:/...) and the file failed to load: 0 of its 4 tests ran on any Windows checkout, in silence because CI runs the desktop unit suite on ubuntu. register() accepts a URL directly — the same idiom every other desktop test file uses — so hand it the URL and drop the import.
There was a problem hiding this comment.
AIUO CodePilot · Preliminary review
Diff-only preliminary review of #2517. The change replaces `pathToFileURL(new URL(...).pathname)` with passing the URL directly to `register()`, removing the `pathToFileURL` import. The claimed Windows failure mode (`.pathname` yielding `/D:/...`, then double-drive `file:///D:/D:/...`) is consistent with Node's URL behavior on Windows, and `register()` accepting a URL string/URL object is correct. I have no repository or runtime access, so I cannot verify the 4/4 pass claim, the register API signature against the repo's Node version, or that the hooks helper resolves identically from the new URL; no defects are evidenced in the added lines.
No evidenced findings in the supplied diff.
Head: 4b16f28
Base: 7b8c316
CI: success; mergeable: true.
Validation: code/tests NOT EXECUTED. Diff-only preliminary analysis; not approval. Human review and repository gates remain required.
Summary
plugin-prompt-enhancement-migration.test.mjsnever ran on Windows: its loader registration built the hook URL, took.pathname(which is/D:/...there), and wrapped it inpathToFileURLagain, producingfile:///D:/D:/...— the register call throws, the file fails to load, and all 4 of its tests are skipped in practice on any Windows checkout. CI does not see this because the desktop unit suite runs on ubuntu.The change
register()accepts a URL directly, which is the idiom every other desktop test file already uses — hand itnew URL("helpers/ts-import-hooks.mjs", here)and drop the now-unused import. No POSIX change (the URL form is exactly what POSIX was resolving to anyway).Same family as #1959, which converted seven desktop tests off this pattern; this file postdates that sweep.
Verification
Windows 11, node 24: the file goes from load failure (0 pass) to 4/4 passing. POSIX behavior is unchanged by construction.