Sha256: a4ced6e276e432b11139289e3c8769d88268c12b6ce17790536e1dfffd6372f1
Contents?: true
Size: 615 Bytes
Versions: 26
Compression:
Stored size: 615 Bytes
Contents
import { getTimestamp } from './getTimestamp' beforeAll(() => { // Stub native `Date` prototype methods used in the tested module, // to always produce a predictable value for testing purposes. vi.spyOn(global.Date.prototype, 'getHours').mockImplementation(() => 12) vi.spyOn(global.Date.prototype, 'getMinutes').mockImplementation(() => 4) vi.spyOn(global.Date.prototype, 'getSeconds').mockImplementation(() => 8) }) afterAll(() => { vi.restoreAllMocks() }) test('returns a timestamp string of the invocation time', () => { const timestamp = getTimestamp() expect(timestamp).toBe('12:04:08') })
Version data entries
26 entries across 26 versions & 1 rubygems