Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix jest-haste-map duplicate manual mock warning (#68993)

Nemanja Glumaccf48b132de89
diff --git a/frontend/src/metabase/common/components/ExplicitSize/__mocks__/index.ts b/frontend/src/metabase/common/components/ExplicitSize/__mocks__/index.ts
deleted file mode 100644
index 91f1f1502c9..00000000000
--- a/frontend/src/metabase/common/components/ExplicitSize/__mocks__/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { ExplicitSize } from "./ExplicitSize";
diff --git a/frontend/src/metabase/query_builder/components/NativeQueryEditor/__mocks__/index.ts b/frontend/src/metabase/query_builder/components/NativeQueryEditor/__mocks__/index.ts
deleted file mode 100644
index 36912b45136..00000000000
--- a/frontend/src/metabase/query_builder/components/NativeQueryEditor/__mocks__/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { NativeQueryEditor } from "./NativeQueryEditor";
diff --git a/frontend/test/register-visualizations.js b/frontend/test/register-visualizations.js
index 80dc500fd33..a82a0cb0a4d 100644
--- a/frontend/test/register-visualizations.js
+++ b/frontend/test/register-visualizations.js
@@ -1,8 +1,12 @@
// We need to mock this *before* registering the visualizations. Otherwise
// `ChartWithLegend` with already load the real one.
-jest.mock("metabase/common/components/ExplicitSize");
+jest.mock("metabase/common/components/ExplicitSize", () =>
+ require("metabase/common/components/ExplicitSize/__mocks__/ExplicitSize"),
+);
// We need to mock this *before* registering the visualizations.
// Otherwise ActionViz loads the NativeQueryEditor (via ActionCreator)
// and tests fail because ace is not properly mocked
-jest.mock("metabase/query_builder/components/NativeQueryEditor");
+jest.mock("metabase/query_builder/components/NativeQueryEditor", () =>
+ require("metabase/query_builder/components/NativeQueryEditor/__mocks__/NativeQueryEditor"),
+);