Skip to content

Commit 70b62bd

Browse files
committed
refactor(tests): improve timestamp test description and cleanup version tests
1 parent efc7fbf commit 70b62bd

File tree

2 files changed

+8
-11
lines changed

2 files changed

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

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

8-
test('timestamp', () => {
9-
expect('should return the current date in ISO 8601 format', () => {
10-
const mockDate = new Date('2025-01-01T00:00:00.000Z')
11-
vi.spyOn(global, 'Date').mockImplementation(() => mockDate)
8+
test('should return the current date in ISO 8601 format', () => {
9+
const mockDate = new Date('2025-01-01T00:00:00.000Z')
10+
vi.spyOn(global, 'Date').mockImplementation(() => mockDate)
1211

13-
const result = timestamp()
12+
const result = timestamp()
1413

15-
expect(result).toBe(mockDate.toISOString())
14+
expect(result).toBe(mockDate.toISOString())
1615

17-
// Restore the original Date implementation
18-
global.Date.mockRestore()
19-
})
16+
// Restore the original Date implementation
17+
global.Date.mockRestore()
2018
})

__tests__/version.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ test('should validate v15.19.4-rc.35', () => {
3131
const version = 'v15.19.4-rc.35'
3232
expect(version).toMatch(versionRegex)
3333
})
34-

0 commit comments

Comments
 (0)