Skip to content

Commit

Permalink
Make some JS tests pending as JS date support is currently limited
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Sep 13, 2022
1 parent 6d574a4 commit b728f05
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/Tests/src/Data/Time/Date_Time_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec_with name create_new_datetime parse_datetime nanoseconds_loss_in_precision=
time.to_json.should_equal <|
zone_pairs = [["zone", Time_Zone.utc]]
time_pairs = [["year", time.year], ["month", time.month], ["day", time.day], ["hour", time.hour], ["minute", time.minute], ["second", time.second], ["nanosecond", time.nanosecond]]
Json.from_pairs ([["type", "Time"]] + time_pairs + zone_pairs)
Json.from_pairs ([["type", "Date_Time"]] + time_pairs + zone_pairs)

Test.specify "should parse default time format" <|
text = create_new_datetime 1970 (zone = Time_Zone.utc) . to_text
Expand Down Expand Up @@ -380,10 +380,13 @@ spec_with name create_new_datetime parse_datetime nanoseconds_loss_in_precision=
offset_1_h = ZoneOffset.ofTotalSeconds 3600
offset_2_h = ZoneOffset.ofTotalSeconds 2*3600
tz = Time_Zone.parse "Europe/Warsaw"
Test.specify "should find start/end of a Date_Period or Time_Period containing the current datetime correctly near the spring DST switch" <|
js_dst_pending = if name.contains "Javascript" then
"Javascript implementation does not support time zones correctly, so the tests for conversion around DST switches would fail and thus are disabled. We may revisit once JS gets better time support, see project Temporal: https://tc39.es/proposal-temporal/docs/ and our Pivotal issue tracking our integration: https://www.pivotaltracker.com/story/show/183261296"
Test.specify "should find start/end of a Date_Period or Time_Period containing the current datetime correctly near the spring DST switch" pending=js_dst_pending <|
d1 = create_new_datetime 2022 3 27 1 34 15 0 tz
d2 = create_new_datetime 2022 3 27 3 34 15 0 tz
(d1 + 1.hour) . should_equal d2
d1_plus = d1 + 1.hour
d1_plus . should_equal d2

check_dates_spring date =
date.start_of Time_Period.Day . should_equal (Date_Time.new 2022 3 27 0 0 0 0 tz)
Expand Down

0 comments on commit b728f05

Please sign in to comment.