@@ -16,43 +16,33 @@ test('i18n - namespaceTranslation', () => {
1616 const { namespaceTranslation } = useI18n < Locale , Locales > ( )
1717
1818 // Single key
19- expect ( namespaceTranslation ( 'hello' ) ) . type . toRaiseError (
20- `Argument of type '"hello"' is not assignable to parameter of type '"doe" | "describe"'` ,
21- )
22-
19+ expect ( namespaceTranslation ) . type . not . toBeCallableWith ( 'hello' )
2320 // Multiple keys
24- expect ( namespaceTranslation ( 'doe.john' ) ) . type . toRaiseError (
25- `Argument of type '"doe.john"' is not assignable to parameter of type '"doe" | "describe"'` ,
26- )
21+ expect ( namespaceTranslation ) . type . not . toBeCallableWith ( 'doe.john' )
2722
2823 expect ( namespaceTranslation ( 'doe' ) ( 'john' ) ) . type . toBe < string > ( )
2924
30- expect ( namespaceTranslation ( 'doe' ) ( 'doesnotexists' ) ) . type . toRaiseError (
31- `Expected 2 arguments, but got 1.` ,
32- )
25+ expect ( namespaceTranslation ( 'doe' ) ) . type . not . toBeCallableWith ( 'doesnotexists' )
3326
3427 // With a param
35- expect ( namespaceTranslation ( 'doe' ) ( 'child' ) ) . type . toRaiseError (
36- `Expected 2 arguments, but got 1.` ,
37- )
28+ expect ( namespaceTranslation ( 'doe' ) ) . type . not . toBeCallableWith ( 'child' )
3829 expect (
3930 namespaceTranslation ( 'doe' ) ( 'child' , {
4031 name : 'Name' ,
4132 } ) ,
4233 ) . type . toBe < string > ( )
43- expect (
44- namespaceTranslation ( 'doe' ) ( 'doesnotexists' , {
34+ expect ( namespaceTranslation ( 'doe' ) ) . type . not . toBeCallableWith (
35+ 'doesnotexists' ,
36+ {
4537 name : 'Name' ,
46- } ) ,
47- ) . type . toRaiseError ( )
48- expect (
49- namespaceTranslation ( 'doe' ) ( 'child' , {
50- doesnotexists : 'Name' ,
51- } ) ,
52- ) . type . toRaiseError ( )
38+ } ,
39+ )
40+ expect ( namespaceTranslation ( 'doe' ) ) . type . not . toBeCallableWith ( 'child' , {
41+ doesnotexists : 'Name' ,
42+ } )
5343
54- expect ( namespaceTranslation ( 'doe' ) ( 'child' , { } ) ) . type . toRaiseError ( )
55- expect ( namespaceTranslation ( 'doe' ) ( 'child' ) ) . type . toRaiseError ( )
44+ expect ( namespaceTranslation ( 'doe' ) ) . type . not . toBeCallableWith ( 'child' , { } )
45+ expect ( namespaceTranslation ( 'doe' ) ) . type . not . toBeCallableWith ( 'child' )
5646
5747 // With multiple params
5848 expect (
@@ -62,12 +52,10 @@ test('i18n - namespaceTranslation', () => {
6252 } ) ,
6353 ) . type . toBe < string > ( )
6454
65- expect ( namespaceTranslation ( 'describe' ) ( 'john' , { } ) ) . type . toRaiseError ( )
66- expect ( namespaceTranslation ( 'describe' ) ( 'john' ) ) . type . toRaiseError ( )
55+ expect ( namespaceTranslation ( 'describe' ) ) . type . not . toBeCallableWith ( 'john' , { } )
56+ expect ( namespaceTranslation ( 'describe' ) ) . type . not . toBeCallableWith ( 'john' )
6757
6858 // Required generic
6959 const { namespaceTranslation : namespaceTranslation2 } = useI18n < Locale > ( )
70- expect ( namespaceTranslation2 ( 'test' ) ) . type . toRaiseError (
71- `Argument of type '"test"' is not assignable to parameter of type` ,
72- )
60+ expect ( namespaceTranslation2 ) . type . not . toBeCallableWith ( 'test' )
7361} )
0 commit comments