Skip to content

fix: use fileURLToPath instead of .pathname - #139

Merged
Nick (ingalls) merged 1 commit into
dfpc-coe:mainfrom
gameroman:fix-tests-on-windows
Aug 28, 2026
Merged

fix: use fileURLToPath instead of .pathname#139
Nick (ingalls) merged 1 commit into
dfpc-coe:mainfrom
gameroman:fix-tests-on-windows

Conversation

@gameroman

Copy link
Copy Markdown
Contributor

Replaced .pathname with fileURLToPath in tests

.pathname does not work correctly on Windows, so the tests were failing locally

@gameroman
Roman (gameroman) marked this pull request as ready for review August 19, 2026 14:21
@ingalls Nick (ingalls) self-assigned this Aug 28, 2026
@ingalls Nick (ingalls) added the enhancement New feature or request label Aug 28, 2026
@ingalls
Nick (ingalls) requested a lite review from Copilot August 28, 2026 16:49
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI 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.

Pull request overview

This PR fixes Windows-local test failures by replacing usage of URL(...).pathname with Node’s fileURLToPath(...) when converting file: URLs into filesystem paths.

Changes:

  • Updated DataPackage.parse(...), DataPackage.hash(...), and fs.createReadStream(...) test inputs to use fileURLToPath(new URL(..., import.meta.url)).
  • Updated CLI test spawning (spawn script path and cwd) to use fileURLToPath(...) for correct Windows paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/package.test.ts Converts file: URLs to proper filesystem paths via fileURLToPath for package fixtures and related hashing/stream reads.
test/cli.test.ts Uses fileURLToPath for the CLI entrypoint path and working directory when spawning Node during tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ingalls
Nick (ingalls) merged commit f481adb into dfpc-coe:main Aug 28, 2026
3 checks passed
@gameroman
Roman (gameroman) deleted the fix-tests-on-windows branch August 28, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants