Skip to content

Commit ddd9be9

Browse files
jessealama12wrigja
authored andcommitted
Drop tests ported to Test262
UPSTREAM_COMMIT=5233a3255951e4b531abcd88a99c828b28e084a8
1 parent bd31585 commit ddd9be9

File tree

3 files changed

+4
-63
lines changed

3 files changed

+4
-63
lines changed

test/expected-failures.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55

66
# https://github.com/tc39/test262/pull/3316
77
intl402/Temporal/TimeZone/from/argument-invalid.js
8+
9+
# https://github.com/tc39/test262/pull/3502
10+
built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/basic.js

test/plaindatetime.mjs

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -18,68 +18,6 @@ import * as Temporal from '@js-temporal/polyfill';
1818
const { PlainDateTime } = Temporal;
1919

2020
describe('DateTime', () => {
21-
describe('DateTime.toZonedDateTime()', () => {
22-
it('works', () => {
23-
const dt = Temporal.PlainDateTime.from('2020-01-01T00:00');
24-
const zdt = dt.toZonedDateTime('America/Los_Angeles');
25-
equal(zdt.toString(), '2020-01-01T00:00:00-08:00[America/Los_Angeles]');
26-
});
27-
it('works with disambiguation option', () => {
28-
const dt = Temporal.PlainDateTime.from('2020-03-08T02:00');
29-
const zdt = dt.toZonedDateTime('America/Los_Angeles', { disambiguation: 'earlier' });
30-
equal(zdt.toString(), '2020-03-08T01:00:00-08:00[America/Los_Angeles]');
31-
});
32-
it('datetime with multiple instants - Fall DST in Brazil', () => {
33-
const dt = PlainDateTime.from('2019-02-16T23:45');
34-
equal(`${dt.toZonedDateTime('America/Sao_Paulo')}`, '2019-02-16T23:45:00-02:00[America/Sao_Paulo]');
35-
equal(
36-
`${dt.toZonedDateTime('America/Sao_Paulo', { disambiguation: 'compatible' })}`,
37-
'2019-02-16T23:45:00-02:00[America/Sao_Paulo]'
38-
);
39-
equal(
40-
`${dt.toZonedDateTime('America/Sao_Paulo', { disambiguation: 'earlier' })}`,
41-
'2019-02-16T23:45:00-02:00[America/Sao_Paulo]'
42-
);
43-
equal(
44-
`${dt.toZonedDateTime('America/Sao_Paulo', { disambiguation: 'later' })}`,
45-
'2019-02-16T23:45:00-03:00[America/Sao_Paulo]'
46-
);
47-
throws(() => dt.toZonedDateTime('America/Sao_Paulo', { disambiguation: 'reject' }), RangeError);
48-
});
49-
it('datetime with multiple instants - Spring DST in Los Angeles', () => {
50-
const dt = PlainDateTime.from('2020-03-08T02:30');
51-
equal(`${dt.toZonedDateTime('America/Los_Angeles')}`, '2020-03-08T03:30:00-07:00[America/Los_Angeles]');
52-
equal(
53-
`${dt.toZonedDateTime('America/Los_Angeles', { disambiguation: 'compatible' })}`,
54-
'2020-03-08T03:30:00-07:00[America/Los_Angeles]'
55-
);
56-
equal(
57-
`${dt.toZonedDateTime('America/Los_Angeles', { disambiguation: 'earlier' })}`,
58-
'2020-03-08T01:30:00-08:00[America/Los_Angeles]'
59-
);
60-
equal(
61-
`${dt.toZonedDateTime('America/Los_Angeles', { disambiguation: 'later' })}`,
62-
'2020-03-08T03:30:00-07:00[America/Los_Angeles]'
63-
);
64-
throws(() => dt.toZonedDateTime('America/Los_Angeles', { disambiguation: 'reject' }), RangeError);
65-
});
66-
it('outside of Instant range', () => {
67-
const max = Temporal.PlainDateTime.from('+275760-09-13T23:59:59.999999999');
68-
throws(() => max.toZonedDateTime('America/Godthab'), RangeError);
69-
});
70-
it('throws on bad disambiguation', () => {
71-
['', 'EARLIER', 'xyz', 3, null].forEach((disambiguation) =>
72-
throws(() => PlainDateTime.from('2019-10-29T10:46').toZonedDateTime('UTC', { disambiguation }), RangeError)
73-
);
74-
});
75-
it('options may be a function object', () => {
76-
const dt = PlainDateTime.from('2019-10-29T10:46:38.271986102');
77-
equal(
78-
`${dt.toZonedDateTime('America/Sao_Paulo', () => {})}`,
79-
'2019-10-29T10:46:38.271986102-03:00[America/Sao_Paulo]'
80-
);
81-
});
82-
});
8321
describe('Min/max range', () => {
8422
it('constructing from numbers', () => {
8523
throws(() => new PlainDateTime(-271821, 4, 19, 0, 0, 0, 0, 0, 0), RangeError);

0 commit comments

Comments
 (0)