Skip to content

Commit

Permalink
fix(i18n): consistent mock emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Feb 3, 2021
1 parent a9e0fca commit 06cc63d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/components/i18n/__tests__/i18n.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
1 change: 1 addition & 0 deletions src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ configure({ adapter: new Adapter() });
/**
* Emulate for component checks
*/
jest.mock('i18next');
jest.mock('lodash/debounce', () => jest.fn(fn => fn));

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/code.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {",
]
`;

0 comments on commit 06cc63d

Please sign in to comment.