diff --git a/client/i18n/config-for-tests.ts b/client/i18n/config-for-tests.ts new file mode 100644 index 0000000000..ee10ec34ed --- /dev/null +++ b/client/i18n/config-for-tests.ts @@ -0,0 +1,21 @@ +import i18n from 'i18next'; +import { initReactI18next } from 'react-i18next'; + +i18n + .use(initReactI18next) + .init({ + debug: true, + defaultNS: 'translations', + fallbackLng: 'en', + interpolation: { + escapeValue: false + }, + lng: 'en', + ns: ['translations'], + resources: { en: { translations: {} } } + }) + .catch((error: Error) => { + throw Error(error.message); + }); + +export default i18n; diff --git a/client/i18n/configForTests.js b/client/i18n/configForTests.js deleted file mode 100644 index 6a1a5ce6ee..0000000000 --- a/client/i18n/configForTests.js +++ /dev/null @@ -1,16 +0,0 @@ -import i18n from 'i18next'; -import { initReactI18next } from 'react-i18next'; - -i18n.use(initReactI18next).init({ - debug: true, - defaultNS: 'translations', - fallbackLng: 'en', - interpolation: { - escapeValue: false - }, - lng: 'en', - ns: ['translations'], - resources: { en: { translations: {} } } -}); - -export default i18n; diff --git a/client/src/components/app-mount-notifier.test.tsx b/client/src/components/app-mount-notifier.test.tsx index ad1645ef19..e3610a61ff 100644 --- a/client/src/components/app-mount-notifier.test.tsx +++ b/client/src/components/app-mount-notifier.test.tsx @@ -4,7 +4,7 @@ import { I18nextProvider } from 'react-i18next'; import { Provider } from 'react-redux'; import { i18nextCodes } from '../../../config/i18n/all-langs'; -import i18nTestConfig from '../../i18n/configForTests'; +import i18nTestConfig from '../../i18n/config-for-tests'; import { createStore } from '../redux/createStore'; import AppMountNotifier from './app-mount-notifier';