budibase/packages/worker/jest.config.ts

29 lines
999 B
TypeScript
Raw Permalink Normal View History

import { Config } from "@jest/types"
import * as fs from "fs"
const config: Config.InitialOptions = {
globalSetup: "./../../globalSetup.ts",
setupFiles: ["./src/tests/jestEnv.ts"],
setupFilesAfterEnv: ["./src/tests/jestSetup.ts"],
collectCoverageFrom: ["src/**/*.{js,ts}", "../backend-core/src/**/*.{js,ts}"],
coverageReporters: ["lcov", "json", "clover"],
transform: {
"^.+\\.ts?$": "@swc/jest",
},
moduleNameMapper: {
2023-01-27 13:36:52 +01:00
"@budibase/backend-core/(.*)": "<rootDir>/../backend-core/$1",
"@budibase/backend-core": "<rootDir>/../backend-core/src",
"@budibase/types": "<rootDir>/../types/src",
2023-05-19 10:36:23 +02:00
"@budibase/shared-core": ["<rootDir>/../shared-core/src"],
2024-03-15 13:40:14 +01:00
"@budibase/string-templates": ["<rootDir>/../string-templates/src"],
},
}
2023-04-14 18:18:15 +02:00
// add pro sources if they exist
if (fs.existsSync("../pro/src")) {
config.moduleNameMapper!["@budibase/pro/(.*)"] = "<rootDir>/../pro/$1"
config.moduleNameMapper!["@budibase/pro"] = "<rootDir>/../pro/src"
2023-04-14 18:18:15 +02:00
}
export default config