diff --git a/scripts/jest/config.json b/scripts/jest/config.json index d329f569df6..7668eed3a37 100644 --- a/scripts/jest/config.json +++ b/scripts/jest/config.json @@ -15,14 +15,14 @@ ], "moduleNameMapper": { "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/scripts/jest/mocks/file_mock.js", - "\\.(css|less|scss)$": "/scripts/jest/mocks/style_mock.js" + "\\.(css|less|scss)$": "/scripts/jest/mocks/style_mock.js", + "/icon$": "/scripts/jest/mocks/icon_mock.js" }, "setupFiles": [ "/scripts/jest/setup/polyfills.js", "/scripts/jest/setup/enzyme.js", "/scripts/jest/setup/throw_on_console_error.js" ], - "setupFilesAfterEnv": ["/scripts/jest/setup/mocks.js"], "coverageDirectory": "/reports/jest-coverage", "coverageReporters": [ "html" diff --git a/scripts/jest/mocks/icon_mock.js b/scripts/jest/mocks/icon_mock.js new file mode 100644 index 00000000000..f7d4989cfd2 --- /dev/null +++ b/scripts/jest/mocks/icon_mock.js @@ -0,0 +1 @@ +export * from '../../../src/components/icon/icon.testenv'; diff --git a/scripts/jest/setup/mocks.js b/scripts/jest/setup/mocks.js deleted file mode 100644 index 809f2851fcd..00000000000 --- a/scripts/jest/setup/mocks.js +++ /dev/null @@ -1,6 +0,0 @@ -jest.mock('../../../src/components/icon', () => { - const { EuiIcon } = require.requireActual('../../../src/components/icon/icon.testenv'); - return { - EuiIcon - }; -}); diff --git a/src/components/empty_prompt/__snapshots__/empty_prompt.test.tsx.snap b/src/components/empty_prompt/__snapshots__/empty_prompt.test.tsx.snap index 264d2c651eb..b93126155c6 100644 --- a/src/components/empty_prompt/__snapshots__/empty_prompt.test.tsx.snap +++ b/src/components/empty_prompt/__snapshots__/empty_prompt.test.tsx.snap @@ -6,15 +6,9 @@ exports[`EuiEmptyPrompt is rendered 1`] = ` class="euiEmptyPrompt testClass1 testClass2" data-test-subj="test subject string" > -
-
{ + return require.requireActual('./icon'); +}); + const prettyHtml = cheerio.load(''); function testIcon(props: PropsOf) {