Skip to content

Conversation

@mukund-2114
Copy link

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.

  • Scope: tests-only
  • Runtime/API changes: none

Changes

  • packages/cli/src/cli/utils/buckets.spec.ts
    • Normalize pathPattern to POSIX-style before equality assertions.
  • packages/cli/src/cli/utils/find-locale-paths.spec.ts
    • Normalize arrays of path patterns in the xcode-xcstrings test case.
  • .changeset/soft-melons-sin.md
    • Patch bump for lingo.dev with: “fix(cli): normalize path separators in tests for Windows”.

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:

  1. pnpm install
  2. pnpm -C packages/cli test

Results:

  • Test Files: 41 passed
  • Tests: 554 passed

Optional: See Issue for failure screenshots before this change.

Breaking Changes

None.

Checklist

Copy link
Contributor

Copilot AI left a comment

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

@@ -0,0 +1,5 @@
---
"lingo.dev": patch
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The package name in the changeset should be '@lingo.dev/cli' or similar, not 'lingo.dev'. The changeset should reference the actual package being changed (the CLI package), not the root project name.

Suggested change
"lingo.dev": patch
"@lingo.dev/cli": patch

Copilot uses AI. Check for mistakes.
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.

CLI tests fail on Windows due to path separator differences

2 participants