Skip to content

Commit

Permalink
Fix or disable tests that are incompatible with older versions of Node.
Browse files Browse the repository at this point in the history
  • Loading branch information
12wrigja committed Jan 27, 2024
1 parent c4d8482 commit cca880f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ describe('ECMAScript', () => {
const missingFromCLDR = ['CET', 'EET', 'MET', 'WET'];

// All IDs that we know about
const ids = [...new Set([...missingFromCLDR, ...cldrIdentifiers, ...Intl.supportedValuesOf('timeZone')])];
// Intl.supportedValuesOf is not available in older runtimes (Node 14)
const IntlNativeIdentifiers = Intl.supportedValuesOf ? Intl.supportedValuesOf('timeZone') : [];
const ids = [...new Set([...missingFromCLDR, ...cldrIdentifiers, ...IntlNativeIdentifiers])];

for (const id of ids) {
const lower = id.toLowerCase();
Expand All @@ -481,6 +483,9 @@ describe('ECMAScript', () => {
}
});
it('Returns canonical IDs', () => {
if (!Intl.supportedValuesOf) {
return; // Some environments don't support Intl.supportedValuesOf.
}
const ids = Intl.supportedValuesOf('timeZone');
for (const id of ids) {
equal(ES.GetAvailableNamedTimeZoneIdentifier(id).primaryIdentifier, id);
Expand Down
3 changes: 3 additions & 0 deletions test/expected-failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
# expected test failures for the transpiled or optimized builds of the polyfill,
# see expected-failures-es5.txt and expected-failures-opt.txt respectively.

# Upstream commit 076f2871 introduces a second ToString call on a calendar when
# canonicalizing the timezone name.
staging/Intl402/Temporal/old/date-time-format.js

0 comments on commit cca880f

Please sign in to comment.