Renamings

This commit is contained in:
adrinr 2023-02-03 19:08:45 +00:00
parent c5b64b1714
commit 0679880b5b
2 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import { Config } from "@jest/types" import { Config } from "@jest/types"
const preset = require("ts-jest/jest-preset") const preset = require("ts-jest/jest-preset")
const testContainersSettings: Config.InitialProjectOptions = { const baseConfig: Config.InitialProjectOptions = {
...preset, ...preset,
preset: "@trendyol/jest-testcontainers", preset: "@trendyol/jest-testcontainers",
setupFiles: ["./tests/jestEnv.ts"], setupFiles: ["./tests/jestEnv.ts"],
@ -13,7 +13,7 @@ const testContainersSettings: Config.InitialProjectOptions = {
if (!process.env.CI) { if (!process.env.CI) {
// use sources when not in CI // use sources when not in CI
testContainersSettings.moduleNameMapper = { baseConfig.moduleNameMapper = {
"@budibase/types": "<rootDir>/../types/src", "@budibase/types": "<rootDir>/../types/src",
} }
} else { } else {
@ -23,13 +23,13 @@ if (!process.env.CI) {
const config: Config.InitialOptions = { const config: Config.InitialOptions = {
projects: [ projects: [
{ {
...testContainersSettings, ...baseConfig,
displayName: "sequential test", displayName: "sequential test",
testMatch: ["<rootDir>/**/*.seq.spec.[jt]s"], testMatch: ["<rootDir>/**/*.seq.spec.[jt]s"],
runner: "jest-serial-runner", runner: "jest-serial-runner",
}, },
{ {
...testContainersSettings, ...baseConfig,
testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"], testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"],
}, },
], ],

View File

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