Skip to content

Commit d9b725e

Browse files
committed
Fix unit tests
1 parent 23d1405 commit d9b725e

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

src/lib/date-time-format/tests/format-to-parts.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
import { describe, it, expect } from 'vitest';
17+
import { Intl } from 'temporal-polyfill';
1718

1819
import { formatDateTimeToParts } from '..';
1920

src/lib/date-time-format/tests/format.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
import { describe, it, expect } from 'vitest';
17+
import { Intl } from 'temporal-polyfill';
1718

1819
import { formatDateTime, formatDate, formatTime } from '..';
1920

src/lib/date-time-format/tests/resolve-format.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
import { describe, it, expect } from 'vitest';
17+
import { Intl } from 'temporal-polyfill';
1718

1819
import { resolveDateTimeFormat } from '..';
1920

src/lib/date-time-format/tests/unsupported-styles.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
import { vi, describe, it, expect } from 'vitest';
17+
import { Intl } from 'temporal-polyfill';
1718

1819
import { formatDateTime } from '..';
1920

vitest.setup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { vi, expect } from 'vitest';
22
import * as matchers from 'jest-extended';
3+
import { Intl as IntlWithTemporal } from 'temporal-polyfill';
34

45
expect.extend(matchers);
56

67
vi.spyOn(Intl, 'NumberFormat');
7-
vi.spyOn(Intl, 'DateTimeFormat');
8+
vi.spyOn(IntlWithTemporal, 'DateTimeFormat');
89

910
// Apparently, Node.js doesn't implement these APIs.
1011
// The mocked return value is based on the test value `1001001001.11111`

0 commit comments

Comments
 (0)