Files
node/test/parallel/test-datetime-change-notify.js
Renegade334 0f90fad89a test: update Intl tests for CLDR 49
* Accept prepended apostrophe to 2-digit year output
  (https://unicode-org.atlassian.net/browse/CLDR-19384)
* Avoid British/Irish metazone, as its behavior has changed
  (https://unicode-org.atlassian.net/browse/CLDR-19382)

Signed-off-by: Renegade334 <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/66992
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-11-25 18:00:47 +01:00

38 lines
856 B
JavaScript

'use strict';
const common = require('../common');
const { isMainThread } = require('worker_threads');
if (!common.hasIntl)
common.skip('Intl not present.');
if (!isMainThread)
common.skip('Test not support running within a worker');
const assert = require('assert');
const cases = [
{
timeZone: 'Etc/UTC',
expected: /Coordinated Universal Time/,
},
{
timeZone: 'America/New_York',
expected: /Eastern (?:Standard|Daylight) Time/,
},
{
timeZone: 'America/Los_Angeles',
expected: /Pacific (?:Standard|Daylight) Time/,
},
{
timeZone: 'Europe/Amsterdam',
expected: /Central European (?:Standard|Summer) Time/,
},
];
for (const { timeZone, expected } of cases) {
process.env.TZ = timeZone;
const date = new Date().toLocaleString('en-US', { timeZoneName: 'long' });
assert.match(date, expected);
}