diff --git a/src/plugins/dashboard/jest_setup.ts b/src/plugins/dashboard/jest_setup.ts index c6318bc3c4df6..68be9b5227e49 100644 --- a/src/plugins/dashboard/jest_setup.ts +++ b/src/plugins/dashboard/jest_setup.ts @@ -6,6 +6,13 @@ * Side Public License, v 1. */ -import { setStubDashboardServices } from './public/mocks'; +import { setStubDashboardServices } from './public/services/mocks'; +/** + * CAUTION: Be very mindful of the things you import in to this `jest_setup` file - anything that is imported + * here (either directly or implicitly through dependencies) will be **unable** to be mocked elsewhere! + * + * Refer to the "Caution" section here: + * https://jestjs.io/docs/jest-object#jestmockmodulename-factory-options + */ setStubDashboardServices(); diff --git a/src/plugins/dashboard/public/mocks.tsx b/src/plugins/dashboard/public/mocks.tsx index 43436a42044b2..1426fa1ac14fa 100644 --- a/src/plugins/dashboard/public/mocks.tsx +++ b/src/plugins/dashboard/public/mocks.tsx @@ -12,8 +12,6 @@ import { mockedReduxEmbeddablePackage } from '@kbn/presentation-util-plugin/publ import { DashboardStart } from './plugin'; import { DashboardContainerInput, DashboardPanelState } from '../common'; import { DashboardContainer } from './dashboard_container/embeddable/dashboard_container'; -import { pluginServices } from './services/plugin_services'; -import { registry } from './services/plugin_services.stub'; export type Start = jest.Mocked; @@ -136,7 +134,3 @@ export function getSampleDashboardPanel