budibase/packages/worker/jest.config.ts

29 lines
1001 B
TypeScript
Raw Normal View History

import { Config } from "@jest/types"
import * as fs from "fs"
const config: Config.InitialOptions = {
2023-01-27 18:59:14 +01:00
preset: "@trendyol/jest-testcontainers",
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