File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/vue-i18n-core/src Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -742,7 +742,7 @@ export function useI18n<
742
742
NonNullable < Options [ 'messages' ] > ,
743
743
NonNullable < Options [ 'datetimeFormats' ] > ,
744
744
NonNullable < Options [ 'numberFormats' ] > ,
745
- Options [ 'locale' ] extends unknown ? string : Options [ 'locale' ]
745
+ NonNullable < Options [ 'locale' ] >
746
746
>
747
747
748
748
export function useI18n <
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
useI18n ,
11
11
createI18n
12
12
} from '../../packages/vue-i18n-core/src/i18n'
13
+ import * as vueI18n from '../../packages/vue-i18n-core/src/i18n'
13
14
import { SchemaParams , LocaleParams } from '../../packages/core-base/src'
14
15
import { ResourceSchema , MyDatetimeScehma , MyNumberSchema } from '../schema'
15
16
@@ -505,3 +506,8 @@ expectType<{ zh: {}; 'ja-JP': { short: {} } }>(
505
506
strictDirectI18n . datetimeFormats . value
506
507
)
507
508
expectType < { ca : { currency : { } } } > ( strictDirectI18n . numberFormats . value )
509
+
510
+ // allow mocking
511
+ vi . spyOn ( vueI18n , 'useI18n' ) . mockReturnValue ( < ReturnType < typeof useI18n > > {
512
+ t : ( key : string ) => `{{${ key } }}`
513
+ } )
You can’t perform that action at this time.
0 commit comments