Fix module mappers
This commit is contained in:
parent
9b3cd812b7
commit
25d0c7040b
|
@ -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 = {
|
const config: Config = {
|
||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
|
@ -28,13 +37,4 @@ const config: Config = {
|
||||||
coverageReporters: ["lcov", "json", "clover"],
|
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
|
export default config
|
||||||
|
|
|
@ -8,6 +8,25 @@ const testContainersSettings = {
|
||||||
preset: "@trendyol/jest-testcontainers",
|
preset: "@trendyol/jest-testcontainers",
|
||||||
setupFiles: ["./src/tests/jestEnv.ts"],
|
setupFiles: ["./src/tests/jestEnv.ts"],
|
||||||
setupFilesAfterEnv: ["./src/tests/jestSetup.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 = {
|
const config: Config = {
|
||||||
|
@ -29,25 +48,6 @@ const config: Config = {
|
||||||
"!src/db/views/staticViews.*",
|
"!src/db/views/staticViews.*",
|
||||||
],
|
],
|
||||||
coverageReporters: ["lcov", "json", "clover"],
|
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
|
export default config
|
||||||
|
|
Loading…
Reference in New Issue