service.ts
import { t } from 'i18next';
export const myFunction = () => t('label.myLabel');
service.spec.ts
jest.mock('i18next', () => ({
t: (label: string) => ({ 'labels.myLabel': 'My Label' }[label]),
}));
service.ts
import { t } from 'i18next';
export const myFunction = () => t('label.myLabel');
service.spec.ts
jest.mock('i18next', () => ({
t: (label: string) => ({ 'labels.myLabel': 'My Label' }[label]),
}));