Refine date tests
This commit is contained in:
parent
fef580e8fa
commit
5bd1602498
@ -30,16 +30,18 @@ describe('Date utility', () => {
|
||||
.toBe('2023-12-02 16:38:36');
|
||||
});
|
||||
});
|
||||
it('Empty string', () => {
|
||||
const timestamp = ' ';
|
||||
const offset = undefined;
|
||||
expect(convertTimestampWithOffsetToPostgresString(
|
||||
timestamp,
|
||||
offset
|
||||
))
|
||||
it('Malformed date string', () => {
|
||||
const timestamp = '2024/01a/01 Z';
|
||||
expect(convertTimestampWithOffsetToPostgresString(timestamp))
|
||||
.toBe(convertTimestampWithOffsetToPostgresString(
|
||||
new Date().toISOString(),
|
||||
));
|
||||
});
|
||||
it('Empty string', () => {
|
||||
const timestamp = ' ';
|
||||
expect(convertTimestampWithOffsetToPostgresString(timestamp))
|
||||
.toBe(convertTimestampWithOffsetToPostgresString(
|
||||
new Date().toISOString(),
|
||||
offset
|
||||
));
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user