From 9fc878590058898336f6615836328457803b1854 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 17 Jan 2023 15:49:56 +0000 Subject: [PATCH] Remove moduleNameMapper in jest --- packages/backend-core/jest.config.ts | 10 ---------- packages/server/jest.config.ts | 17 ----------------- packages/worker/jest.config.ts | 19 ------------------- 3 files changed, 46 deletions(-) diff --git a/packages/backend-core/jest.config.ts b/packages/backend-core/jest.config.ts index e5993f6596..6240675ade 100644 --- a/packages/backend-core/jest.config.ts +++ b/packages/backend-core/jest.config.ts @@ -11,14 +11,4 @@ const config: Config.InitialOptions = { }, } -if (!process.env.CI) { - // use sources when not in CI - config.moduleNameMapper = { - "@budibase/types": "/../types/src", - "^axios.*$": "/node_modules/axios/lib/axios.js", - } -} else { - console.log("Running tests with compiled dependency sources") -} - export default config diff --git a/packages/server/jest.config.ts b/packages/server/jest.config.ts index e9337001a4..f5f7e5ff88 100644 --- a/packages/server/jest.config.ts +++ b/packages/server/jest.config.ts @@ -16,21 +16,4 @@ const config: Config.InitialOptions = { }, } -if (!process.env.CI) { - // use sources when not in CI - config.moduleNameMapper = { - "@budibase/backend-core/(.*)": "/../backend-core/$1", - "@budibase/backend-core": "/../backend-core/src", - "@budibase/types": "/../types/src", - "^axios.*$": "/node_modules/axios/lib/axios.js", - } - // add pro sources if they exist - if (fs.existsSync("../../../budibase-pro")) { - config.moduleNameMapper["@budibase/pro"] = - "/../../../budibase-pro/packages/pro/src" - } -} else { - console.log("Running tests with compiled dependency sources") -} - export default config diff --git a/packages/worker/jest.config.ts b/packages/worker/jest.config.ts index 21b7ee6763..f526ad7e47 100644 --- a/packages/worker/jest.config.ts +++ b/packages/worker/jest.config.ts @@ -12,23 +12,4 @@ const config: Config.InitialOptions = { }, } -if (!process.env.CI) { - // use sources when not in CI - config.moduleNameMapper = { - "@budibase/backend-core/(.*)": "/../backend-core/$1", - "@budibase/backend-core": "/../backend-core/src", - "@budibase/types": "/../types/src", - "^axios.*$": "/node_modules/axios/lib/axios.js", - } - // add pro sources if they exist - if (fs.existsSync("../../../budibase-pro")) { - config.moduleNameMapper["@budibase/pro/(.*)"] = - "/../../../budibase-pro/packages/pro/$1" - config.moduleNameMapper["@budibase/pro"] = - "/../../../budibase-pro/packages/pro/src" - } -} else { - console.log("Running tests with compiled dependency sources") -} - export default config