fix(edge-apps-library): make locale tests cross-platform for ICU version differences#693
fix(edge-apps-library): make locale tests cross-platform for ICU version differences#693nicomiguelino wants to merge 3 commits intomasterfrom
Conversation
…ion differences
- Handle hi-IN dayPeriod variations ('pm' on Linux, 'अ' on macOS) using a known-values set
- Use toContain() for hi-IN formatted time assertion instead of a full-string regex
- Extract ru locale into a standalone test with lowercase normalization for short day names
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR Reviewer Guide 🔍(Review updated until commit 75d1963)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 75d1963
Previous suggestionsSuggestions up to commit 75d1963
|
|
Persistent review updated to latest commit 75d1963 |
There was a problem hiding this comment.
Pull request overview
This PR makes locale-related unit tests cross-platform compatible by handling ICU version differences between operating systems (older ICU on Linux/CI vs newer ICU on macOS). The changes focus on relaxing overly-strict test assertions that were failing due to legitimate locale formatting variations across different ICU implementations.
Changes:
- Modified
hi-INlocale test informat-time.test.tsto accept multiple valid PM representations - Relaxed
hi-INformatted time assertion to use substring matching instead of strict regex - Extracted Russian locale test in
get-localized-day-names.test.tsto handle case-insensitive short day name comparison
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| edge-apps/edge-apps-library/src/utils/format-time.test.ts | Updated hi-IN hour12 test to accept multiple ICU-specific PM representations and relaxed formatted string assertion |
| edge-apps/edge-apps-library/src/utils/get-localized-day-names.test.ts | Isolated Russian locale test from parametrized loop and added lowercase normalization for abbreviated day names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
User description
Summary
hi-INdayPeriodoutput varies by ICU version: older ICU (Linux/CI) returns'pm'while newer ICU (macOS) returns'अ'; assert against a known-values set instead of a hardcoded stringhi-INformatted string order also differs, so usetoContain('02:30:45')instead of a full-string regexruinto a standalone test that normalizes to lowercase before comparingPR Type
Tests
Description
Make
hi-INtime tests ICU-tolerantdayPeriodvaluesStabilize
ruday-name tests across ICUDiagram Walkthrough
File Walkthrough
format-time.test.ts
Loosen hi-IN assertions for ICU varianceedge-apps/edge-apps-library/src/utils/format-time.test.ts
knownPmValuesset forhi-INdayPerioddayPeriodequality with set membershiptoContain('02:30:45')get-localized-day-names.test.ts
Split ru test and normalize abbreviationsedge-apps/edge-apps-library/src/utils/get-localized-day-names.test.ts
rufrom shared locale expectation tablerutest with explicit full namesshortnames after lowercasing values