Skip to content

Commit

Permalink
fix: don't use Date.now
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Nov 8, 2023
1 parent fecaecc commit e6b1f9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useBlockTimestamp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('useBlockTimestamp', () => {
})

it('should return the latest block timestamp', async () => {
const timestamp = Date.now() / 1000
const timestamp = 69420

mockGetBlock.mockResolvedValue({
timestamp,
Expand All @@ -49,7 +49,7 @@ describe('useBlockTimestamp', () => {
})

it('should update the timestamp every INTERVAL', async () => {

Check failure on line 51 in src/hooks/useBlockTimestamp.test.ts

View workflow job for this annotation

GitHub Actions / Tests annotations (🧪 jest-coverage-report-action)

useBlockTimestamp > should update the timestamp every INTERVAL

Error: expect(received).toBe(expected) // Object.is equality Expected: 69422 Received: 69421 Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> at toBe (/home/runner/work/safe-wallet-web/safe-wallet-web/src/hooks/useBlockTimestamp.test.ts:71:30) at runWithExpensiveErrorDiagnosticsDisabled (/home/runner/work/safe-wallet-web/safe-wallet-web/node_modules/@testing-library/dom/dist/config.js:47:12) at checkCallback (/home/runner/work/safe-wallet-web/safe-wallet-web/node_modules/@testing-library/dom/dist/wait-for.js:127:77) at checkRealTimersCallback (/home/runner/work/safe-wallet-web/safe-wallet-web/node_modules/@testing-library/dom/dist/wait-for.js:121:16) at Timeout.task [as _onTimeout] (/home/runner/work/safe-wallet-web/safe-wallet-web/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19) at listOnTimeout (node:internal/timers:569:17) at processTimers (node:internal/timers:512:7)
const timestamp = Date.now() / 1000
const timestamp = 69420

mockGetBlock.mockResolvedValue({
timestamp,
Expand Down

0 comments on commit e6b1f9e

Please sign in to comment.