Skip to content

Commit 6a9f7bb

Browse files
committed
Add Internationalization to test
1 parent 7f824a7 commit 6a9f7bb

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

tests/App.test.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
import { render } from 'vitest-browser-react';
22
import App from '../src/App.tsx';
3-
import { /*expect,*/ test } from "vitest";
3+
import { beforeAll, /*expect,*/ test } from "vitest";
4+
import i18n from 'i18next';
5+
import { I18nextProvider, initReactI18next } from 'react-i18next';
6+
7+
beforeAll(() => {
8+
// Initialize i18next with a basic configuration for testing
9+
i18n
10+
.use(initReactI18next)
11+
.init({
12+
lng: 'en',
13+
fallbackLng: 'en',
14+
resources: {
15+
en: {
16+
translation: {}
17+
}
18+
}
19+
});
20+
});
421

522
test('renders app', async () => {
6-
render(<App />);
23+
render(
24+
<I18nextProvider i18n={i18n}>
25+
<App />
26+
</I18nextProvider>);
727
// TODO: Add some expect statements.
828
});

0 commit comments

Comments
 (0)