Best way to stub/mock Vue-i18n for a Vue3 component unit test? #1320
Unanswered
MacArmstrong
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You can do this: import { config } from '@vue/test-utils'
config.global.mocks ??= {}
config.global.mocks.t = (str) => str |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using this library to translate text within my components: vue-i18n
How do I stub/mock the translation library in Vitest to prevent this error:
ReferenceError: t is not defined
?Here is a list of some notable package versions:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions