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"
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": "<rootDir>/../types/src",
}
} else {
@ -23,13 +23,13 @@ if (!process.env.CI) {
const config: Config.InitialOptions = {
projects: [
{
...testContainersSettings,
...baseConfig,
displayName: "sequential test",
testMatch: ["<rootDir>/**/*.seq.spec.[jt]s"],
runner: "jest-serial-runner",
},
{
...testContainersSettings,
...baseConfig,
testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"],
},
],

View File

@ -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/(.*)": "<rootDir>/../backend-core/$1",
"@budibase/backend-core": "<rootDir>/../backend-core/src",
"@budibase/types": "<rootDir>/../types/src",
}
// add pro sources if they exist
if (fs.existsSync("../../../budibase-pro")) {
testContainersSettings.moduleNameMapper["@budibase/pro"] =
baseConfig.moduleNameMapper["@budibase/pro"] =
"<rootDir>/../../../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: ["<rootDir>/**/*.seq.spec.[jt]s"],
runner: "jest-serial-runner",
},
{
...testContainersSettings,
...baseConfig,
testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"],
},
],