fix(cli): make tests OS-agnostic by normalizing path separators#1288
fix(cli): make tests OS-agnostic by normalizing path separators#1288mukund-2114 wants to merge 3 commits intolingodotdev:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes test failures on Windows by normalizing path separators in test assertions. The tests were failing because Windows uses backslashes while the expected values used forward slashes. The fix ensures tests pass on all operating systems without modifying runtime code.
Key changes:
- Added helper functions to normalize path separators to POSIX-style (forward slashes) in test assertions
- Applied normalization to test results before comparison in buckets.spec.ts and find-locale-paths.spec.ts
- Added changeset documenting the patch fix
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/cli/src/cli/utils/buckets.spec.ts | Added normalizeBuckets helper to convert path separators before assertions |
| packages/cli/src/cli/utils/find-locale-paths.spec.ts | Added normalize helper to convert path separators in patterns and defaultPatterns |
| .changeset/soft-melons-sin.md | Documented patch-level change for CLI path separator fix |
| lingo.dev | Added subproject commit reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When I go to https://github.com//pull/1288/changes, I see the following (please see screenshot).
What is this change exactly? It's unrelated to the PR, so please remove. |
|
Hey @mukund-2114! Just checking in - are you still working on this PR? We noticed there are some comments that may need addressing. If you need more time, no problem! Just let us know. If we don't hear back within a week, we'll close this to keep the repo tidy, but you can always reopen when ready. |
|
Closing this PR as stale to keep the repo clean. Feel free to reopen or create a new PR once you're ready to continue. Thanks for your contribution! |

Fixes #1280
Summary
On Windows, several CLI tests failed due to backslash vs forward slash path separators in expected vs received values. This PR normalizes path strings in test assertions so comparisons are OS-agnostic.
Changes
pathPatternto POSIX-style before equality assertions.Rationale
Path separators differ across OSes. Normalizing in tests ensures consistent behavior across Windows/macOS/Linux without touching runtime code.
Test Plan
Environment: Windows 11, Node v22.19.0, pnpm 9.12.3
Steps:
pnpm installpnpm -C packages/cli testResults:
Optional: See Issue for failure screenshots before this change.
Breaking Changes
None.
Checklist