Fix module mappers
This commit is contained in:
parent
7b3a273ca6
commit
83d4045c01
|
@ -11,6 +11,15 @@ const testContainersSettings = {
|
|||
},
|
||||
}
|
||||
|
||||
if (!process.env.CI) {
|
||||
// use sources when not in CI
|
||||
testContainersSettings.moduleNameMapper = {
|
||||
"@budibase/types": "<rootDir>/../types/src",
|
||||
}
|
||||
} else {
|
||||
console.log("Running tests with compiled dependency sources")
|
||||
}
|
||||
|
||||
const config: Config = {
|
||||
projects: [
|
||||
{
|
||||
|
@ -28,13 +37,4 @@ const config: Config = {
|
|||
coverageReporters: ["lcov", "json", "clover"],
|
||||
}
|
||||
|
||||
if (!process.env.CI) {
|
||||
// use sources when not in CI
|
||||
config.moduleNameMapper = {
|
||||
"@budibase/types": "<rootDir>/../types/src",
|
||||
}
|
||||
} else {
|
||||
console.log("Running tests with compiled dependency sources")
|
||||
}
|
||||
|
||||
export default config
|
||||
|
|
|
@ -8,6 +8,25 @@ const testContainersSettings = {
|
|||
preset: "@trendyol/jest-testcontainers",
|
||||
setupFiles: ["./src/tests/jestEnv.ts"],
|
||||
setupFilesAfterEnv: ["./src/tests/jestSetup.ts"],
|
||||
transform: {
|
||||
"^.+\\.ts?$": "@swc/jest",
|
||||
},
|
||||
}
|
||||
|
||||
if (!process.env.CI) {
|
||||
// use sources when not in CI
|
||||
testContainersSettings.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"] =
|
||||
"<rootDir>/../../../budibase-pro/packages/pro/src"
|
||||
}
|
||||
} else {
|
||||
console.log("Running tests with compiled dependency sources")
|
||||
}
|
||||
|
||||
const config: Config = {
|
||||
|
@ -29,25 +48,6 @@ const config: Config = {
|
|||
"!src/db/views/staticViews.*",
|
||||
],
|
||||
coverageReporters: ["lcov", "json", "clover"],
|
||||
transform: {
|
||||
"^.+\\.ts?$": "@swc/jest",
|
||||
},
|
||||
}
|
||||
|
||||
if (!process.env.CI) {
|
||||
// use sources when not in CI
|
||||
config.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")) {
|
||||
config.moduleNameMapper["@budibase/pro"] =
|
||||
"<rootDir>/../../../budibase-pro/packages/pro/src"
|
||||
}
|
||||
} else {
|
||||
console.log("Running tests with compiled dependency sources")
|
||||
}
|
||||
|
||||
export default config
|
||||
|
|
Loading…
Reference in New Issue