Fix jest when no pro access

This commit is contained in:
adrinr 2023-04-14 17:18:15 +01:00
parent d9d8243d4c
commit 7bd4c39929
2 changed files with 14 additions and 3 deletions

View File

@ -16,10 +16,15 @@ const baseConfig: Config.InitialProjectOptions = {
"@budibase/backend-core": "<rootDir>/../backend-core/src",
"@budibase/shared-core": "<rootDir>/../shared-core/src",
"@budibase/types": "<rootDir>/../types/src",
"@budibase/pro": "<rootDir>/../pro/packages/pro/src",
},
}
// add pro sources if they exist
if (fs.existsSync("../pro/packages")) {
baseConfig.moduleNameMapper!["@budibase/pro"] =
"<rootDir>/../pro/packages/pro/src"
}
const config: Config.InitialOptions = {
projects: [
{

View File

@ -16,9 +16,15 @@ const config: Config.InitialOptions = {
"@budibase/backend-core/(.*)": "<rootDir>/../backend-core/$1",
"@budibase/backend-core": "<rootDir>/../backend-core/src",
"@budibase/types": "<rootDir>/../types/src",
"@budibase/pro/(.*)": "<rootDir>/../pro/packages/pro/$1",
"@budibase/pro": "<rootDir>/../pro/packages/pro/src",
},
}
// add pro sources if they exist
if (fs.existsSync("../pro/packages")) {
config.moduleNameMapper!["@budibase/pro/(.*)"] =
"<rootDir>/../pro/packages/pro/$1"
config.moduleNameMapper!["@budibase/pro"] =
"<rootDir>/../pro/packages/pro/src"
}
export default config