From 2f632db0eadbbb13a773d52951ef4bf501c07354 Mon Sep 17 00:00:00 2001 From: CD Cabrera Date: Tue, 2 Feb 2021 12:06:19 -0500 Subject: [PATCH] fix(i18n): consistent mock emulation (#572) --- src/components/i18n/__tests__/i18n.test.js | 5 ----- src/setupTests.js | 1 + tests/__snapshots__/code.test.js.snap | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/i18n/__tests__/i18n.test.js b/src/components/i18n/__tests__/i18n.test.js index 209038c9b..1e84c5750 100644 --- a/src/components/i18n/__tests__/i18n.test.js +++ b/src/components/i18n/__tests__/i18n.test.js @@ -7,11 +7,6 @@ import _get from 'lodash/get'; import { I18n, translate, translateComponent } from '../i18n'; import enLocales from '../../../../public/locales/en-US'; -/** - * Emulate for component render checks - */ -jest.mock('i18next'); - /** * Get translation keys. * diff --git a/src/setupTests.js b/src/setupTests.js index c4cd4bfe6..3f3a51bad 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -8,6 +8,7 @@ configure({ adapter: new Adapter() }); /** * Emulate for component checks */ +jest.mock('i18next'); jest.mock('lodash/debounce', () => jest.fn); /** diff --git a/tests/__snapshots__/code.test.js.snap b/tests/__snapshots__/code.test.js.snap index f6f5fdfb9..a6c9f8105 100644 --- a/tests/__snapshots__/code.test.js.snap +++ b/tests/__snapshots__/code.test.js.snap @@ -4,6 +4,6 @@ exports[`General code checks should only have specific console.[warn|log|info|er Array [ "redux/common/reduxHelpers.js:250: console.error(\`Error: Property \${prop} does not exist within the passed state.\`, state);", "redux/common/reduxHelpers.js:254: console.warn(\`Warning: Property \${prop} does not exist within the passed initialState.\`, initialState);", - "setupTests.js:66: console.error = (message, ...args) => {", + "setupTests.js:67: console.error = (message, ...args) => {", ] `;