Skip to content

Commit 94574e9

Browse files
committed
Fix ts tests
1 parent e392ebe commit 94574e9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/unit/util/ts.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)