Skip to content

Commit

Permalink
switch test toEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
rosskevin committed Jan 22, 2025
1 parent 7850c92 commit 37cccef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/logger-node/src/__tests__/timestamp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { timestamp } from '../timestamp.js'
describe('timestamp', () => {
const date = new Date('2025-01-02T03:04:05.006Z')
it('should format date', () => {
expect(timestamp('YYYY-MM-DD HH:mm:ss.ms', false, date)).toBe('2025-01-01 21:04:05.006')
expect(timestamp('YYYY-MM-DD HH:mm:ss.ms', true, date)).toBe('2025-01-02 03:04:05.006')
expect(timestamp('HH:mm:ss', false, date)).toBe('21:04:05')
expect(timestamp('HH:mm:ss', true, date)).toBe('03:04:05')
expect(timestamp('YYYY-MM-DD HH:mm:ss.ms', false, date)).toEqual('2025-01-01 21:04:05.006')

Check failure on line 8 in packages/logger-node/src/__tests__/timestamp.test.ts

View workflow job for this annotation

GitHub Actions / release

src/__tests__/timestamp.test.ts > timestamp > should format date

AssertionError: expected '2025-01-02 03:04:05.006' to deeply equal '2025-01-01 21:04:05.006' Expected: "2025-01-01 21:04:05.006" Received: "2025-01-02 03:04:05.006" ❯ src/__tests__/timestamp.test.ts:8:62
expect(timestamp('YYYY-MM-DD HH:mm:ss.ms', true, date)).toEqual('2025-01-02 03:04:05.006')
expect(timestamp('HH:mm:ss', false, date)).toEqual('21:04:05')
expect(timestamp('HH:mm:ss', true, date)).toEqual('03:04:05')
})
})

0 comments on commit 37cccef

Please sign in to comment.