diff --git a/packages/backend-core/jest.config.ts b/packages/backend-core/jest.config.ts index 742339cda5..0483fb073a 100644 --- a/packages/backend-core/jest.config.ts +++ b/packages/backend-core/jest.config.ts @@ -1,7 +1,7 @@ import { Config } from "@jest/types" const preset = require("ts-jest/jest-preset") -const testContainersSettings: Config.InitialProjectOptions = { +const baseConfig: Config.InitialProjectOptions = { ...preset, preset: "@trendyol/jest-testcontainers", setupFiles: ["./tests/jestEnv.ts"], @@ -13,7 +13,7 @@ const testContainersSettings: Config.InitialProjectOptions = { if (!process.env.CI) { // use sources when not in CI - testContainersSettings.moduleNameMapper = { + baseConfig.moduleNameMapper = { "@budibase/types": "/../types/src", } } else { @@ -23,13 +23,13 @@ if (!process.env.CI) { const config: Config.InitialOptions = { projects: [ { - ...testContainersSettings, + ...baseConfig, displayName: "sequential test", testMatch: ["/**/*.seq.spec.[jt]s"], runner: "jest-serial-runner", }, { - ...testContainersSettings, + ...baseConfig, testMatch: ["/**/!(*.seq).spec.[jt]s"], }, ], diff --git a/packages/server/jest.config.ts b/packages/server/jest.config.ts index 8e42c2cd40..41558d4c8e 100644 --- a/packages/server/jest.config.ts +++ b/packages/server/jest.config.ts @@ -3,7 +3,7 @@ import { Config } from "@jest/types" import * as fs from "fs" const preset = require("ts-jest/jest-preset") -const testContainersSettings: Config.InitialProjectOptions = { +const baseConfig: Config.InitialProjectOptions = { ...preset, preset: "@trendyol/jest-testcontainers", setupFiles: ["./src/tests/jestEnv.ts"], @@ -15,14 +15,14 @@ const testContainersSettings: Config.InitialProjectOptions = { if (!process.env.CI) { // use sources when not in CI - testContainersSettings.moduleNameMapper = { + baseConfig.moduleNameMapper = { "@budibase/backend-core/(.*)": "/../backend-core/$1", "@budibase/backend-core": "/../backend-core/src", "@budibase/types": "/../types/src", } // add pro sources if they exist if (fs.existsSync("../../../budibase-pro")) { - testContainersSettings.moduleNameMapper["@budibase/pro"] = + baseConfig.moduleNameMapper["@budibase/pro"] = "/../../../budibase-pro/packages/pro/src" } } else { @@ -32,13 +32,13 @@ if (!process.env.CI) { const config: Config.InitialOptions = { projects: [ { - ...testContainersSettings, + ...baseConfig, displayName: "sequential test", testMatch: ["/**/*.seq.spec.[jt]s"], runner: "jest-serial-runner", }, { - ...testContainersSettings, + ...baseConfig, testMatch: ["/**/!(*.seq).spec.[jt]s"], }, ],