File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,6 @@ afterEach(() => {
1010 MockDate . reset ( )
1111} )
1212
13- // result in millisecond might cause little different in millisecond which is acceptable
14- const ignoreLastNumber = num => ( String ( num ) . slice ( 0 , - 1 ) )
15-
1613test ( 'Format no formatStr' , ( ) => {
1714 expect ( dayjs ( ) . format ( ) ) . toBe ( moment ( ) . format ( ) )
1815} )
@@ -70,11 +67,11 @@ it('Difference', () => {
7067
7168 const momentA = moment ( )
7269 const momentB = moment ( dateString )
73- expect ( ignoreLastNumber ( dayjsA . diff ( dayjsB ) ) ) . toBe ( ignoreLastNumber ( momentA . diff ( momentB ) ) )
70+ expect ( dayjsA . diff ( dayjsB ) ) . toBe ( momentA . diff ( momentB ) )
7471} )
7572
7673it ( 'Unix Timestamp (milliseconds)' , ( ) => {
77- expect ( ignoreLastNumber ( dayjs ( ) . valueOf ( ) ) ) . toBe ( ignoreLastNumber ( moment ( ) . valueOf ( ) ) )
74+ expect ( dayjs ( ) . valueOf ( ) ) . toBe ( moment ( ) . valueOf ( ) )
7875} )
7976
8077it ( 'Unix Timestamp (seconds)' , ( ) => {
You can’t perform that action at this time.
0 commit comments