© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
How to properly mock useI18n for Vitest? - Nuxt
N
Nuxt
•
4y ago
Buffet Time
How to properly mock useI18n for Vitest?
I have a language switcher using
@nuxtjs/i18n
@nuxtjs/i18n
and using the
useI18n
useI18n
function for the language switcher
. But when I get to my testing using
vitest
vitest
for this I can
't find a way to mock this so it doesn
't fail with
ReferenceError: useI18n is not defined
ReferenceError: useI18n is not defined
Recent Announcements
Similar Threads
How to mock refs in Vitest?
N
Nuxt / ❓・help
17mo ago
Ho do I properly mock UseFetch in vitest
N
Nuxt / ❓・help
2mo ago
How to mock/test useCookie with Vitest & Vue Test Utils?
N
Nuxt / ❓・help
13mo ago
How to use "useI18n" on "server/api" directory
N
Nuxt / ❓・help
3y ago