close
Skip to content

test(path): run path tests in node and bun#7104

Open
kt3k wants to merge 1 commit intodenoland:mainfrom
kt3k:test-path-in-node-bun
Open

test(path): run path tests in node and bun#7104
kt3k wants to merge 1 commit intodenoland:mainfrom
kt3k:test-path-in-node-bun

Conversation

@kt3k
Copy link
Copy Markdown
Contributor

@kt3k kt3k commented Apr 24, 2026

This PR adds tests of path in Node and Bun

ref #7103

@github-actions github-actions Bot added the path label Apr 24, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.61%. Comparing base (0796a25) to head (161b494).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7104   +/-   ##
=======================================
  Coverage   94.60%   94.61%           
=======================================
  Files         633      633           
  Lines       51777    51777           
  Branches     9324     9324           
=======================================
+ Hits        48986    48987    +1     
  Misses       2216     2216           
+ Partials      575      574    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread path/posix/to_file_url.ts
const url = new URL("file:///");
url.pathname = encodeWhitespace(
path.replace(/%/g, "%25").replace(/\\/g, "%5C"),
path.replace(/^\/+/, "/").replace(/%/g, "%25").replace(/\\/g, "%5C"),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The below works differently in Deno and Node:

const u = new URL("file:///");
u.pathname = "//foo";
console.log(u.href);
// prints file:///foo in Deno
// prints file:////foo in Node, Bun, and browsers

This change normalizes the differences above (and therefore no breaking changes to deno users)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created an issue in rust-url about the above behavior servo/rust-url#1118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant