Skip to content
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

Reduce locale dependence in non-iso-calendars.js #4048

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Apr 9, 2024

This is a staging test that was tightly coupled to particular 'golden' output from toLocaleString. Rewrite it so that it uses formatToParts instead, and tests for the presence of particular parts, and their values.

Also removes some dead logging code from this test file.

The performance logging was left over from when this test lived in the
proposal-temporal repo. It was already switched off anyway.
@ptomato ptomato force-pushed the locale-dependent-calendar-formatting branch from 8a2765f to be809b8 Compare April 10, 2024 14:48
@ptomato ptomato requested a review from Ms2ger April 10, 2024 14:49
Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

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

Thanks!

test/staging/Intl402/Temporal/old/non-iso-calendars.js Outdated Show resolved Hide resolved
@ptomato ptomato force-pushed the locale-dependent-calendar-formatting branch from be809b8 to 550028e Compare April 10, 2024 15:33
ptomato added 2 commits April 10, 2024 08:33
Previously, this test checked for a particular format. This would break
depending on which engine executed it. Instead, test for the presence of
particular types and their values in the output of formatToParts().

(There's an existing comment which suggests that this should already have
been testing formatToParts().)
Using Object.keys() of the expected values in each case decouples these
tests.
@ptomato ptomato merged commit d865ffe into tc39:main Apr 10, 2024
8 checks passed
@ptomato ptomato deleted the locale-dependent-calendar-formatting branch April 10, 2024 15:37
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