Skip to content

Commit 871c3d5

Browse files
committed
fix: Remove Node deps
1 parent 001cda0 commit 871c3d5

File tree

4 files changed

+66
-144
lines changed

4 files changed

+66
-144
lines changed

package-lock.json

Lines changed: 0 additions & 65 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/Main.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/Main.purs

Lines changed: 66 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,8 @@ import Partial.Unsafe as Unsafe
4646
import Test.Assert.Extended as Test
4747
import Unsafe.Coerce as Unsafe.Coerce
4848

49-
foreign import _polyfill :: Effect Unit
50-
5149
main :: Effect Unit
5250
main = do
53-
_polyfill
54-
5551
test_Intl
5652

5753
test_Collator
@@ -63,7 +59,6 @@ main = do
6359
test_PluralRules
6460
test_RelativeTimeFormat
6561
test_Segmenter
66-
test_DurationFormat
6762

6863
test_LocaleSensitive
6964

@@ -984,68 +979,70 @@ unsafeParseDateTime :: String -> Effect DateTime
984979
unsafeParseDateTime string = Unsafe.unsafePartial do
985980
Maybe.fromJust <<< JSDate.toDateTime <$> JSDate.parse string
986981

987-
test_DurationFormat :: Effect Unit
988-
test_DurationFormat = do
989-
en_US <- Locale.new_ "en-US"
990-
991-
Console.log "DurationFormat.supportedLocalesOf"
992-
Test.assertEqual
993-
{ actual: DurationFormat.supportedLocalesOf [ en_US ] { localeMatcher: "best fit" }
994-
, expected: [ "en-US" ]
995-
}
996-
997-
Console.log "DurationFormat.supportedLocalesOf_"
998-
Test.assertEqual
999-
{ actual: DurationFormat.supportedLocalesOf_ [ en_US ]
1000-
, expected: [ "en-US" ]
1001-
}
1002-
1003-
format <- DurationFormat.new [ en_US ] { numberingSystem: "latn", fractionalDigits: 0 }
1004-
1005-
Console.log "DurationFormat.format"
1006-
Test.assertEqual
1007-
{ actual: DurationFormat.format format { milliseconds: 1.0 }
1008-
, expected: "1 ms"
1009-
}
1010-
1011-
Console.log "DurationFormat.formatToParts"
1012-
Test.assertEqual
1013-
{ actual: DurationFormat.formatToParts format { days: 1.0 }
1014-
, expected:
1015-
[ { type: "integer", value: "1" }
1016-
, { type: "literal", value: " " }
1017-
, { type: "unit", value: "day" }
1018-
]
1019-
}
982+
-- TODO: Not yet supported in Node
1020983

1021-
Console.log "DurationFormat.resolvedOptions"
1022-
resolvedOptions <- DurationFormat.resolvedOptions format
1023-
Test.assertEqual
1024-
{ actual: resolvedOptions
1025-
, expected:
1026-
{ locale: "en"
1027-
, style: "short"
1028-
, years: "short"
1029-
, yearsDisplay: "auto"
1030-
, months: "short"
1031-
, monthsDisplay: "auto"
1032-
, weeks: "short"
1033-
, weeksDisplay: "auto"
1034-
, days: "short"
1035-
, daysDisplay: "auto"
1036-
, hours: "short"
1037-
, hoursDisplay: "auto"
1038-
, minutes: "short"
1039-
, minutesDisplay: "auto"
1040-
, seconds: "short"
1041-
, secondsDisplay: "auto"
1042-
, milliseconds: "short"
1043-
, millisecondsDisplay: "auto"
1044-
, microseconds: "short"
1045-
, microsecondsDisplay: "auto"
1046-
, nanoseconds: "short"
1047-
, nanosecondsDisplay: "auto"
1048-
, numberingSystem: "latn"
1049-
, fractionalDigits: 0
1050-
}
1051-
}
984+
-- test_DurationFormat :: Effect Unit
985+
-- test_DurationFormat = do
986+
-- en_US <- Locale.new_ "en-US"
987+
988+
-- Console.log "DurationFormat.supportedLocalesOf"
989+
-- Test.assertEqual
990+
-- { actual: DurationFormat.supportedLocalesOf [ en_US ] { localeMatcher: "best fit" }
991+
-- , expected: [ "en-US" ]
992+
-- }
993+
994+
-- Console.log "DurationFormat.supportedLocalesOf_"
995+
-- Test.assertEqual
996+
-- { actual: DurationFormat.supportedLocalesOf_ [ en_US ]
997+
-- , expected: [ "en-US" ]
998+
-- }
999+
1000+
-- format <- DurationFormat.new [ en_US ] { numberingSystem: "latn", fractionalDigits: 0 }
1001+
1002+
-- Console.log "DurationFormat.format"
1003+
-- Test.assertEqual
1004+
-- { actual: DurationFormat.format format { milliseconds: 1.0 }
1005+
-- , expected: "1 ms"
1006+
-- }
1007+
1008+
-- Console.log "DurationFormat.formatToParts"
1009+
-- Test.assertEqual
1010+
-- { actual: DurationFormat.formatToParts format { days: 1.0 }
1011+
-- , expected:
1012+
-- [ { type: "integer", value: "1" }
1013+
-- , { type: "literal", value: " " }
1014+
-- , { type: "unit", value: "day" }
1015+
-- ]
1016+
-- }
1017+
1018+
-- Console.log "DurationFormat.resolvedOptions"
1019+
-- resolvedOptions <- DurationFormat.resolvedOptions format
1020+
-- Test.assertEqual
1021+
-- { actual: resolvedOptions
1022+
-- , expected:
1023+
-- { locale: "en"
1024+
-- , style: "short"
1025+
-- , years: "short"
1026+
-- , yearsDisplay: "auto"
1027+
-- , months: "short"
1028+
-- , monthsDisplay: "auto"
1029+
-- , weeks: "short"
1030+
-- , weeksDisplay: "auto"
1031+
-- , days: "short"
1032+
-- , daysDisplay: "auto"
1033+
-- , hours: "short"
1034+
-- , hoursDisplay: "auto"
1035+
-- , minutes: "short"
1036+
-- , minutesDisplay: "auto"
1037+
-- , seconds: "short"
1038+
-- , secondsDisplay: "auto"
1039+
-- , milliseconds: "short"
1040+
-- , millisecondsDisplay: "auto"
1041+
-- , microseconds: "short"
1042+
-- , microsecondsDisplay: "auto"
1043+
-- , nanoseconds: "short"
1044+
-- , nanosecondsDisplay: "auto"
1045+
-- , numberingSystem: "latn"
1046+
-- , fractionalDigits: 0
1047+
-- }
1048+
-- }

0 commit comments

Comments
 (0)