Skip to content

Commit bf8d393

Browse files
authored
Merge pull request #422 from github/dependabot/npm_and_yarn/npm-dependencies-8a42d5a426
Bump the npm-dependencies group with 4 updates
2 parents fff1c7a + 51e925c commit bf8d393

File tree

7 files changed

+372
-899
lines changed

7 files changed

+372
-899
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import {timestamp} from '../../src/functions/timestamp.js'
2-
import {vi, expect, test, beforeEach} from 'vitest'
2+
import {vi, expect, test, beforeEach, afterEach} from 'vitest'
33

44
beforeEach(() => {
55
vi.clearAllMocks()
66
})
77

8+
afterEach(() => {
9+
vi.useRealTimers()
10+
})
11+
812
test('should return the current date in ISO 8601 format', () => {
913
const mockDate = new Date('2025-01-01T00:00:00.000Z')
10-
vi.spyOn(global, 'Date').mockImplementation(() => mockDate)
14+
vi.setSystemTime(mockDate)
1115

1216
const result = timestamp()
1317

14-
expect(result).toBe(mockDate.toISOString())
15-
16-
// Restore the original Date implementation
17-
global.Date.mockRestore()
18+
expect(result).toBe('2025-01-01T00:00:00.000Z')
1819
})

dist/index.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)