test(paths): make path assertions cross-platform for win32 - #113
Open
ytexplorer wants to merge 1 commit into
Open
test(paths): make path assertions cross-platform for win32#113ytexplorer wants to merge 1 commit into
ytexplorer wants to merge 1 commit into
Conversation
paths.ts builds paths with path.join, which emits the platform-native separator (backslashes on win32), so the hardcoded forward-slash string assertions failed on Windows (26 of 30 tests). Normalize the actual value to forward slashes before comparing — the assertions describe path structure, not separator style. Source is unchanged; helpers keep emitting native separators for real fs/ffmpeg consumers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017apBXb1xwSg1g9VshnJ7qK
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.
What
scripts/config/paths.test.tshad 26 of 30 tests failing on Windows. Thepaths.tshelpers build paths withpath.join, which emits the platform-native separator — backslashes on win32 — while the assertions compared against hardcoded forward-slash literals (.toBe('/project/root/...')).This normalizes the actual value to forward slashes before comparing, keeping the readable forward-slash expected strings. The assertions describe path structure, not separator style.
Why not fix the source
paths.tsproducing native separators is correct — real scripts pass these paths tofs/ffmpeg. Forcing POSIX separators in the source would change Windows runtime behavior for no benefit. The bug is in the test's assertions, so the fix is test-only.Scope
scripts/config/paths.test.ts(test-only, zero runtime change).Verification
npx jest scripts/config/paths.test.ts→ 30/30 pass (was 26 failed, 4 passed)..husky/pre-pushhook now passes without--no-verifyon this machine.🤖 Generated with Claude Code