We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84d656f commit 64ea130Copy full SHA for 64ea130
1 file changed
src/app/components/TableCellAge/__tests__/index.test.tsx
@@ -16,11 +16,17 @@ describe('TableCellAge', () => {
16
vi.setSystemTime(new Date('2024-02-05T10:14:35.000Z'))
17
18
// Fix locale-specific mock output
19
- vi.spyOn(Intl, 'DateTimeFormat').mockImplementation(
20
- () =>
21
- ({
22
- format: () => '05-02-2024, 10:14:40',
23
- }) as unknown as Intl.DateTimeFormat,
+ const OriginalDateTimeFormat = Intl.DateTimeFormat
+ vi.stubGlobal(
+ 'Intl',
+ Object.assign({}, Intl, {
+ DateTimeFormat: function (...args: ConstructorParameters<typeof Intl.DateTimeFormat>) {
24
+ const instance = new OriginalDateTimeFormat(...args)
25
+ return Object.assign({}, instance, {
26
+ format: () => '05-02-2024, 10:14:40',
27
+ })
28
+ },
29
+ }),
30
)
31
})
32
0 commit comments