11import { act , renderHook } from '@testing-library/react-hooks'
22import mockdate from 'mockdate'
3+ import { ReactNode } from 'react'
34import I18n , { useI18n , useTranslation } from '..'
45import en from './locales/en.json'
56import es from './locales/es.json'
@@ -20,7 +21,7 @@ const wrapper =
2021 localeItemStorage = LOCALE_ITEM_STORAGE ,
2122 supportedLocales = [ 'en' , 'fr' , 'es' ] ,
2223 } = { } ) =>
23- ( { children } : { children : React . ReactNode } ) =>
24+ ( { children } : { children : ReactNode } ) =>
2425 (
2526 < I18n
2627 loadDateLocale = { loadDateLocale }
@@ -45,7 +46,7 @@ describe('i18n hook', () => {
4546
4647 it ( 'useTranslation should not be defined without I18nProvider' , ( ) => {
4748 const { result } = renderHook ( ( ) => useTranslation ( ) , {
48- wrapper : ( { children } ) => < div > { children } </ div > ,
49+ wrapper : ( { children } : { children : ReactNode } ) => < div > { children } </ div > ,
4950 } )
5051 expect ( ( ) => {
5152 expect ( result . current ) . toBe ( undefined )
@@ -54,7 +55,7 @@ describe('i18n hook', () => {
5455
5556 it ( 'useI18n should not be defined without I18nProvider' , ( ) => {
5657 const { result } = renderHook ( ( ) => useI18n ( ) , {
57- wrapper : ( { children } ) => < div > { children } </ div > ,
58+ wrapper : ( { children } : { children : ReactNode } ) => < div > { children } </ div > ,
5859 } )
5960 expect ( ( ) => {
6061 expect ( result . current ) . toBe ( undefined )
0 commit comments