cobalt-ui icon indicating copy to clipboard operation
cobalt-ui copied to clipboard

Tests overly sensitive to locale

Open mrginglymus opened this issue 1 month ago • 1 comments

Running tests on my windows machine, I get errors like:

@@ -1,6 +1,6 @@
- [lint:core/valid-stroke-style] Value most be one of solid, dashed, dotted, double, groove, ridge, outset, or inset.
+ [lint:core/valid-stroke-style] Value most be one of solid, dashed, dotted, double, groove, ridge, outset or inset.

As my locale doesn't seem to like oxford commas.

We need to mock Intl to detect the same locale in tests.

mrginglymus avatar Nov 23 '25 16:11 mrginglymus

So on Linux this is easily fixable by running the tests with LC_ALL=en_US.UTF-8. On windows....might be easier to just skip any tests that assert on Intl output...

mrginglymus avatar Nov 29 '25 22:11 mrginglymus

I might just enforce en-us locale on all machines since the error messages are hardcoded to English anyway 🤔.

drwpow avatar Dec 06 '25 18:12 drwpow

...I was so obsessed with the presence of the comma I completely missed that point! Yes, fixing to en_US makes sense until you have translations ;)

mrginglymus avatar Dec 07 '25 09:12 mrginglymus

Yeah it makes more sense to leave blank for Intl.DateTimeFormat(), since times are cursed anyway (also as an American I personally despise the nonsensical MM/DD/YY format and don’t want to subject anyone else to that). But for strings there’s not much point, and it was probably just force of habit

drwpow avatar Dec 08 '25 17:12 drwpow