Issue with NextIntlClientProvider in Unit Testing using Jest: Type Undefined #879
-
Hello everyone, I'm working on an application where I'm using next-intl and App Router for the first time. I've set up next-intl in my application, and it seems to be working correctly. ProblemAfter installing Jest and Testing Library, I created unit tests for the pages of my application (which currently only have a title using next-intl). For each of these pages, I wrap the page component with
However, when I try to do the same with a component (in this case, the Header component), the
Here's the error generated:
So far, I only have the
QuestionDo you know how I can solve this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hmm, that's quite odd. Did you compare your implementation to the one from As a side note, you shouldn't have to mock |
Beta Was this translation helpful? Give feedback.
Hmm, that's quite odd.
Did you compare your implementation to the one from
example-app-router
?jest.config.js
Navigation.spec.tsx
As a side note, you shouldn't have to mock
next-intl
for your test.