Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
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
Nuxt
Join
Nuxt Community Chat Server
31,817
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
How to mock refs in Vitest?
N
Nuxt / ❓・help
15mo ago
How to mock/test useCookie with Vitest & Vue Test Utils?
N
Nuxt / ❓・help
12mo ago
How to use "useI18n" on "server/api" directory
N
Nuxt / ❓・help
3y ago
How to mock useRouter().push()
N
Nuxt / ❓・help
15mo ago