1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 12:30:32 +09:00
namae/src/setupTests.ts

27 lines
702 B
TypeScript
Raw Normal View History

2019-08-03 00:35:23 +09:00
// this adds jest-dom's custom assertions
2019-09-17 14:30:26 +09:00
import '@testing-library/jest-dom/extend-expect';
2019-08-14 18:46:57 +09:00
// i18next
2019-09-17 14:30:26 +09:00
import {join} from 'path';
import i18n from 'i18next';
import Backend from 'i18next-node-fs-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import {initReactI18next} from 'react-i18next';
2019-08-14 18:46:57 +09:00
i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
backend: {
loadPath: join(__dirname, '../public/locales/{{lng}}/{{ns}}.json'),
},
fallbackLng: 'en',
ns: ['translation'],
defaultNS: 'translation',
debug: false,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
2019-09-17 14:30:26 +09:00
});