budibase/packages/backend-core/jest.config.ts

37 lines
930 B
TypeScript
Raw Normal View History

2023-02-03 20:07:41 +01:00
import { Config } from "@jest/types"
2023-02-03 20:08:45 +01:00
const baseConfig: Config.InitialProjectOptions = {
setupFiles: ["./tests/jestEnv.ts"],
globalSetup: "./src/tests/globalSetup.ts",
globalTeardown: "./src/tests/globalTeardown.ts",
setupFilesAfterEnv: ["./tests/jestSetup.ts"],
transform: {
"^.+\\.ts?$": "@swc/jest",
},
moduleNameMapper: {
2023-02-01 12:02:29 +01:00
"@budibase/types": "<rootDir>/../types/src",
"@budibase/shared-core": ["<rootDir>/../shared-core/src"],
},
2023-02-01 12:02:29 +01:00
}
2023-02-03 20:07:41 +01:00
const config: Config.InitialOptions = {
projects: [
{
2023-02-03 20:08:45 +01:00
...baseConfig,
displayName: "sequential test",
testMatch: ["<rootDir>/**/*.seq.spec.[jt]s"],
runner: "jest-serial-runner",
},
{
2023-02-03 20:08:45 +01:00
...baseConfig,
testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"],
},
],
2023-02-01 11:57:05 +01:00
collectCoverageFrom: ["src/**/*.{js,ts}"],
coverageReporters: ["lcov", "json", "clover"],
}
process.env.DISABLE_PINO_LOGGER = "1"
export default config