Skip to content

i18n always null when run unit test #1957

Discussion options

You must be logged in to vote

OK found the solution..

Added mock in jest config file

// config.ts

jest.mock('next-i18next', () => ({
  i18n: { t: (input: string) => input },
}));

Not sure why mock at test file not working

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@blackblue2712
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by blackblue2712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants