mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-04 14:32:15 +08:00
Just save this
[ci skip]
This commit is contained in:
20
jest.setup.js
Normal file
20
jest.setup.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import "@testing-library/jest-dom";
|
||||
import "./jest.i18n.js";
|
||||
|
||||
jest.mock("utils/proxy/use-widget-api");
|
||||
|
||||
jest.mock("next-i18next", () => {
|
||||
const reactI18next = require("react-i18next");
|
||||
const i18n = require("./jest.i18n").default;
|
||||
|
||||
return {
|
||||
useTranslation: () => reactI18next.useTranslation("", { i18n }),
|
||||
Trans: reactI18next.Trans,
|
||||
I18nextProvider: reactI18next.I18nextProvider,
|
||||
appWithTranslation: (Component) => (props) => (
|
||||
<reactI18next.I18nextProvider i18n={i18n}>
|
||||
<Component {...props} />
|
||||
</reactI18next.I18nextProvider>
|
||||
),
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user