Skip to content

Commit

Permalink
fix: support all i18next functions when mocking the module
Browse files Browse the repository at this point in the history
  • Loading branch information
atheck committed Sep 8, 2023
1 parent a4f2a0d commit 629040a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/jest/mockI18next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function mockCreateI18nValue (key: string, options?: unknown): string {
}

if (isInstalled("jest", "i18next")) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
jest.mock("i18next", () => ({
...jest.requireActual("i18next"),
async init (): Promise<void> {
return undefined;
},
Expand Down

0 comments on commit 629040a

Please sign in to comment.