Replies: 2 comments 3 replies
-
I guess I should TL;DR this: Is there a way to mock Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Why would you want to mock What you could do in addition is configure |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys!
I'd like to mock
next-intl
useTranslations
function/hook so I could test my components without having to ever guess what language it's being tested. For that, I want the component to render it with its keys translations instead of its value.For example, for a server component, the component below:
It will just render the key
'wonderful'
in my jest test because I don't need / want to check its value - but i do want to test if it's being rendered!...and then this would just pass.
My question here is to do the same with
next-int
anduseTranslations
hook. If I try to mock it just like the functiongetTranslations
above, nothing happens.Do you know how I could get the same result as getTranslations above?
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions