File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -9,19 +9,20 @@ describe('UTIL: ts', () => {
99 const result1 = ts . getTimestampString ( new Date ( 'December 17, 1995 03:24:00' ) ) ;
1010 const result2 = ts . getTimestampString ( new Date ( 'December 17, 1995 15:24:00' ) ) ;
1111
12- expect ( result1 ) . to . equal ( '1995121732400 ' ) ;
13- expect ( result2 ) . to . equal ( '1995121732400 ' ) ;
12+ expect ( result1 ) . to . equal ( '19951217032400 ' ) ;
13+ expect ( result2 ) . to . equal ( '19951217032400 ' ) ;
1414 } ) ;
1515
1616 it ( 'should return a timestamp string with the current date if date is not provided.' , ( ) => {
17+ const now = new Date ( ) ;
1718 const result = ts . getTimestampString ( ) ;
1819
19- expect ( result . startsWith ( new Date ( ) . getFullYear ( ) . toString ( ) ) ) ;
20- expect ( result . length ) . to . equal ( 13 ) ;
20+ expect ( result . startsWith ( now . getFullYear ( ) . toString ( ) ) ) ;
21+ expect ( result . length ) . to . equal ( 14 ) ;
2122 } ) ;
2223
2324 it ( 'should return a value fully numeric.' , ( ) => {
24- expect ( ts . getTimestampString ( ) ) . to . match ( / ^ \d + $ / ) ;
25+ expect ( ts . getTimestampString ( ) ) . to . match ( / ^ \d { 14 } $ / ) ;
2526 } ) ;
2627 } ) ;
2728} ) ;
You can’t perform that action at this time.
0 commit comments