fix(test): resolve the WebDAV handler path with fileURLToPath - #13196
Merged
diegosouzapw merged 1 commit intoSep 11, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
diegosouzapw
merged commit Sep 11, 2026
edfcb8b
into
diegosouzapw:release/v3.8.51
8 of 16 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…ouzapw#13196) Correct: `URL.pathname` is a URL path, so on Windows it yields `/C:/...` and `path.resolve` produces the doubled `C:\C:\` prefix. `fileURLToPath` is the right decoder and also un-escapes `%20`. All 37 WebDAV tests green here. --- Validated in one consolidated worktree cut from `release/v3.8.51`, boarded together with the other 13 PRs of this batch — zero merge conflicts between them. - `typecheck:core` clean - complexity 2799 / baseline 3218 and cognitive-complexity 1265 / baseline 1437 — both under baseline - 71 focused assertions green across the 13 test files this batch adds or touches⚠️ base-red inherited: diegosouzapw#12732 — `Docs Gates (fast-path)`, `Merge integrity`, `No new ESLint warnings`, `Unit Tests fast-path` and `Fast Quality Gates` all reproduce on the pure `release/v3.8.51` tip (provider count 356 vs the 358 the modules define, SKILL.md drift, and `open-sse/utils/stream.ts` at 3115 > frozen 3098). None of them touch this diff. Thanks @anhtahaylove — the root-cause write-up, the measured before/after numbers and the red-before-green proof on every one of these made the batch reviewable as a unit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
All 37 tests in
tests/unit/webdav-server-3485.test.tsfail on Windows:Note the doubled drive prefix. The handler path is built from
URL.pathname:URL.pathnamereturns a URL path, not an OS path. On POSIX the two happen to coincide, so this works. On Windows it yields/C:/Users/...— a leading slash before the drive letter.path.resolvedoes not consider that absolute, so it prepends the CWD and producesC:\C:\..., which cannot be imported.CI runs on Linux, so this never shows up there; it only costs Windows contributors, silently, on every run.
Fix
Use
fileURLToPath, which decodes afile:URL to a real OS path on every platform. (It also un-escapes percent-encoding, so paths containing spaces work —URL.pathnamewould leave%20in place.)node:urlwas already imported here forpathToFileURL.Verification
Same file, same machine (Windows), before and after:
Found while auditing why a local full-suite run reports failures that CI does not. This accounts for 37 of them.