Skip to content

fix(tests): run the prompt-enhancement migration suite on Windows too - #2517

Merged
vastsa merged 1 commit into
vastsa:mainfrom
SeanLiu326:fix/prompt-migration-windows-url
Nov 23, 2026
Merged

vastsa merged 1 commit into
vastsa:mainfrom
SeanLiu326:fix/prompt-migration-windows-url

Conversation

@SeanLiu326

Copy link
Copy Markdown
Contributor

Summary

plugin-prompt-enhancement-migration.test.mjs never ran on Windows: its loader registration built the hook URL, took .pathname (which is /D:/... there), and wrapped it in pathToFileURL again, producing file:///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 it new 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.

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.

@aiuo-codepilot aiuo-codepilot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vastsa
vastsa merged commit 1927e6a into vastsa:main Nov 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants