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<
742742 NonNullable < Options [ 'messages' ] > ,
743743 NonNullable < Options [ 'datetimeFormats' ] > ,
744744 NonNullable < Options [ 'numberFormats' ] > ,
745- Options [ 'locale' ] extends unknown ? string : Options [ 'locale' ]
745+ NonNullable < Options [ 'locale' ] >
746746>
747747
748748export function useI18n <
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 useI18n ,
1111 createI18n
1212} from '../../packages/vue-i18n-core/src/i18n'
13+ import * as vueI18n from '../../packages/vue-i18n-core/src/i18n'
1314import { SchemaParams , LocaleParams } from '../../packages/core-base/src'
1415import { ResourceSchema , MyDatetimeScehma , MyNumberSchema } from '../schema'
1516
@@ -505,3 +506,8 @@ expectType<{ zh: {}; 'ja-JP': { short: {} } }>(
505506 strictDirectI18n . datetimeFormats . value
506507)
507508expectType < { 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