Skip to content

fix(hmr): resolve test fixture paths on Windows - #58

Open
SamhandsomeLee wants to merge 1 commit into
cordiverse:mainfrom
SamhandsomeLee:main
Open

fix(hmr): resolve test fixture paths on Windows#58
SamhandsomeLee wants to merge 1 commit into
cordiverse:mainfrom
SamhandsomeLee:main

Conversation

@SamhandsomeLee

Copy link
Copy Markdown

Summary

  • HMR tests failed to load on Windows because new URL(...).pathname is not a filesystem path (/E:/cordis/...).
  • path.resolve() then produced E:\E:\cordis\..., so fixture files such as plugin.ts could not be opened.
  • Resolve the test directory with dirname(fileURLToPath(import.meta.url)), which is the Node-standard conversion from import.meta.url.

Test plan

  • yarn yakumo vitest --import tsx hmr on Windows (Node 24): 26/26 passed
  • yarn test on Ubuntu (existing CI) still passes

URL.pathname is not a filesystem path on Windows, so HMR fixtures failed to open.
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.

1 participant