Skip to content

Commit d17baf9

Browse files
committed
Fix lint in test
1 parent 8868626 commit d17baf9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/use-intl/src/react/useFormatter.test.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
type DateTimeFormatOptions,
88
type IntlError,
99
IntlErrorCode,
10-
type NumberFormatOptions
10+
type NumberFormatOptions,
11+
type RelativeTimeFormatOptions
1112
} from '../core.js';
1213
import IntlProvider from './IntlProvider.js';
1314
import useFormatter from './useFormatter.js';
@@ -432,13 +433,15 @@ describe('number', () => {
432433
describe('relativeTime', () => {
433434
function renderRelativeTime(
434435
date: Date | number,
435-
nowOrOptions: Parameters<
436-
ReturnType<typeof useFormatter>['relativeTime']
437-
>['1']
436+
nowOrOptions: Date | number | RelativeTimeFormatOptions
438437
) {
439438
function Component() {
440439
const format = useFormatter();
441-
return <>{format.relativeTime(date, nowOrOptions)}</>;
440+
if (nowOrOptions instanceof Date || typeof nowOrOptions === 'number') {
441+
return format.relativeTime(date, nowOrOptions);
442+
} else {
443+
return format.relativeTime(date, nowOrOptions);
444+
}
442445
}
443446

444447
render(

0 commit comments

Comments
 (0)