Skip to content

Commit 0bc0415

Browse files
justingrant12wrigja
authored andcommitted
Intl test fixes for Lunisolar math (part of #2211)
UPSTREAM_COMMIT=bf85d75e95ad5625c30c647d0d12ac32de127931
1 parent aba0f1d commit 0bc0415

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/intl.mjs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,19 +1242,28 @@ describe('Intl', () => {
12421242
equal(added.monthCode, date.monthCode);
12431243
equal(added.year, date.year + 2);
12441244
});
1245-
it('Adding years across Chinese leap month', () => {
1245+
const testChineseData = new Date('2001-02-01T00:00Z').toLocaleString('en-US-u-ca-chinese', {
1246+
day: 'numeric',
1247+
month: 'numeric',
1248+
year: 'numeric',
1249+
era: 'short',
1250+
timeZone: 'UTC'
1251+
});
1252+
const hasOutdatedChineseIcuData = !testChineseData.endsWith('2001');
1253+
const itOrSkip = hasOutdatedChineseIcuData ? it.skip : it;
1254+
itOrSkip('Adding years across Chinese leap month', () => {
12461255
const date = Temporal.PlainDate.from({ year: 2000, monthCode: 'M08', day: 2, calendar: 'chinese' });
12471256
const added = date.add({ years: 1 });
12481257
equal(added.monthCode, date.monthCode);
12491258
equal(added.year, date.year + 1);
12501259
});
1251-
it('Adding months across Chinese leap month', () => {
1260+
itOrSkip('Adding months across Chinese leap month', () => {
12521261
const date = Temporal.PlainDate.from({ year: 2000, monthCode: 'M08', day: 2, calendar: 'chinese' });
12531262
const added = date.add({ months: 13 });
12541263
equal(added.monthCode, date.monthCode);
12551264
equal(added.year, date.year + 1);
12561265
});
1257-
it('Adding months and years across Chinese leap month', () => {
1266+
itOrSkip('Adding months and years across Chinese leap month', () => {
12581267
const date = Temporal.PlainDate.from({ year: 2001, monthCode: 'M08', day: 2, calendar: 'chinese' });
12591268
const added = date.add({ years: 1, months: 12 });
12601269
equal(added.monthCode, date.monthCode);

0 commit comments

Comments
 (0)