Skip to content

Make temporal tests locale independent #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

rkh
Copy link
Contributor

@rkh rkh commented Mar 25, 2025

Currently, the temporal tests assume that the system language is set to en_US and break otherwise:

$ LANG=en_US.UTF-8 npm run test
...
338 passing (64ms)
  2 pending

With a different locale

$ LANG=de npm run test
...
  336 passing (67ms)
  2 pending
  2 failing

  1) Temporal support
       Temporal.Instant
         direct interpolation:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
actual expected

'1/.1/.1970, 01:00:00 AM'

      + expected - actual

      -1/1/1970, 1:00:00 AM
      +1.1.1970, 01:00:00

      at Context.<anonymous> (file:///Users/konstantin/Workspace/rkh/fluent.js/fluent-bundle/test/temporal_test.js:50:14)
      at process.processImmediate (node:internal/timers:511:21)

  2) Temporal support
       Temporal.Instant
         run through DATETIME():

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
actual expected

'1/.1/.1970, 01:00:00 AM'

      + expected - actual

      -1/1/1970, 1:00:00 AM
      +1.1.1970, 01:00:00

      at Context.<anonymous> (file:///Users/konstantin/Workspace/rkh/fluent.js/fluent-bundle/test/temporal_test.js:54:14)
      at process.processImmediate (node:internal/timers:511:21)

This PR fixes the issue by explicitly setting the locale in the tests.

@eemeli eemeli merged commit 92c2cbf into projectfluent:main Mar 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants