1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-18 04:50:32 +09:00
namae/web/src/setupTests.ts

27 lines
699 B
TypeScript
Raw Normal View History

2019-08-03 00:35:23 +09:00
// this adds jest-dom's custom assertions
import '@testing-library/jest-dom/extend-expect'
2019-08-14 18:46:57 +09:00
// i18next
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'
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
},
})