node/test/parallel/test-temporal-with-zoneinfo.js
Chengzhong Wu e8a5a82ca4 test: add basic temporal presence check
PR-URL: https://github.com/nodejs/node/pull/60703
Refs: https://github.com/nodejs/node/issues/58730
Refs: https://github.com/nodejs/node/pull/60693
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-11-23 15:41:31 +00:00

20 lines
655 B
JavaScript

// Flags: --harmony-temporal
'use strict';
const common = require('../common');
const assert = require('assert');
if (!process.config.variables.v8_enable_temporal_support) {
common.skip('Temporal is not enabled');
}
// TODO(legendecas): bundle zoneinfo data for small ICU and without ICU builds.
if (!common.hasFullICU) {
common.skip('Time zone support unavailable when not built with full ICU');
}
// Use globalThis.Temporal to workaround linter complaints.
assert.strictEqual(typeof globalThis.Temporal, 'object');
const pdt = globalThis.Temporal.Instant.from('1969-07-20T20:17:00Z');
assert.strictEqual(pdt.toString(), '1969-07-20T20:17:00Z');