Files
ToBePlayed-Frontend/src/test/i18n-mock.js
T
lobo bad11807e0 test: component tests with jsdom and Testing Library
First tests cover the library search debounce (fails on the old looping
version), the Pile of Shame states and the backlog save body. jsdom is
enabled per test file, so the plain util tests stay in the node environment.
2026-09-24 12:06:34 +02:00

7 lines
384 B
JavaScript

// Module mock for react-i18next: t() returns the key (plus ":<count>" for plurals), so tests do not depend on the texts.
// Use in a test file: vi.mock('react-i18next', () => import('../test/i18n-mock.js'));
const t = (key, options) => (options?.count === undefined ? key : `${key}:${options.count}`);
const i18n = {language: 'de'};
export const useTranslation = () => ({t, i18n});