@@ -37,47 +37,25 @@ describe('Velocity $context.util.time', () => {
37
37
} ) ;
38
38
39
39
it ( 'parseFormattedToEpochMilliSeconds' , ( ) => {
40
- expect (
41
- time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_UTC , FORMAT_CUSTOM_ZONED )
42
- ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
43
- expect (
44
- time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_PLUS8 , FORMAT_CUSTOM_ZONED )
45
- ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
46
- expect (
47
- time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_UTC , FORMAT_CUSTOM_ZONED )
48
- ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
49
- expect (
50
- time . parseFormattedToEpochMilliSeconds (
51
- TEST_TIMESTAMP_CUSTOM_PLUS8 ,
52
- FORMAT_CUSTOM_ZONED ,
53
- 'Australia/Perth'
54
- )
55
- ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
56
- expect (
57
- time . parseFormattedToEpochMilliSeconds (
58
- TEST_TIMESTAMP_CUSTOM_UTC_UNZONED ,
59
- FORMAT_CUSTOM_UNZONED ,
60
- 'UTC'
61
- )
62
- ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
63
-
64
- expect (
65
- time . parseFormattedToEpochMilliSeconds (
66
- TEST_TIMESTAMP_CUSTOM_PLUS8_UNZONED ,
67
- FORMAT_CUSTOM_UNZONED ,
68
- 'Australia/Perth'
69
- )
70
- ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
71
- } ) ;
72
-
73
- it ( 'parseISO8601ToEpochMilliSeconds' , ( ) => {
74
- expect ( time . parseISO8601ToEpochMilliSeconds ( TEST_TIMESTAMP_ZULU ) ) . toEqual (
40
+ expect ( time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_UTC , FORMAT_CUSTOM_ZONED ) ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
41
+ expect ( time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_PLUS8 , FORMAT_CUSTOM_ZONED ) ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
42
+ expect ( time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_UTC , FORMAT_CUSTOM_ZONED ) ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
43
+ expect ( time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_PLUS8 , FORMAT_CUSTOM_ZONED , 'Australia/Perth' ) ) . toEqual (
44
+ TEST_TIMESTAMP_MILLIS
45
+ ) ;
46
+ expect ( time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_UTC_UNZONED , FORMAT_CUSTOM_UNZONED , 'UTC' ) ) . toEqual (
75
47
TEST_TIMESTAMP_MILLIS
76
48
) ;
77
- expect ( time . parseISO8601ToEpochMilliSeconds ( TEST_TIMESTAMP_PLUS8 ) ) . toEqual (
49
+
50
+ expect ( time . parseFormattedToEpochMilliSeconds ( TEST_TIMESTAMP_CUSTOM_PLUS8_UNZONED , FORMAT_CUSTOM_UNZONED , 'Australia/Perth' ) ) . toEqual (
78
51
TEST_TIMESTAMP_MILLIS
79
52
) ;
80
53
} ) ;
54
+
55
+ it ( 'parseISO8601ToEpochMilliSeconds' , ( ) => {
56
+ expect ( time . parseISO8601ToEpochMilliSeconds ( TEST_TIMESTAMP_ZULU ) ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
57
+ expect ( time . parseISO8601ToEpochMilliSeconds ( TEST_TIMESTAMP_PLUS8 ) ) . toEqual ( TEST_TIMESTAMP_MILLIS ) ;
58
+ } ) ;
81
59
it ( 'epochMilliSecondsToSeconds' , ( ) => {
82
60
expect ( time . epochMilliSecondsToSeconds ( TEST_TIMESTAMP_MILLIS ) ) . toEqual ( TEST_TIMESTAMP_SECS ) ;
83
61
} ) ;
@@ -86,16 +64,10 @@ describe('Velocity $context.util.time', () => {
86
64
} ) ;
87
65
88
66
it ( 'epochMilliSecondsToFormatted' , ( ) => {
89
- expect ( time . epochMilliSecondsToFormatted ( TEST_TIMESTAMP_MILLIS , FORMAT_CUSTOM_ZONED ) ) . toEqual (
90
- TEST_TIMESTAMP_CUSTOM_UTC
91
- ) ;
67
+ expect ( time . epochMilliSecondsToFormatted ( TEST_TIMESTAMP_MILLIS , FORMAT_CUSTOM_ZONED ) ) . toEqual ( TEST_TIMESTAMP_CUSTOM_UTC ) ;
92
68
93
- expect (
94
- time . epochMilliSecondsToFormatted (
95
- TEST_TIMESTAMP_MILLIS ,
96
- FORMAT_CUSTOM_ZONED ,
97
- 'Australia/Perth'
98
- )
99
- ) . toEqual ( TEST_TIMESTAMP_CUSTOM_PLUS8 ) ;
69
+ expect ( time . epochMilliSecondsToFormatted ( TEST_TIMESTAMP_MILLIS , FORMAT_CUSTOM_ZONED , 'Australia/Perth' ) ) . toEqual (
70
+ TEST_TIMESTAMP_CUSTOM_PLUS8
71
+ ) ;
100
72
} ) ;
101
73
} ) ;
0 commit comments