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

35 lines
834 B
TypeScript
Raw Normal View History

2023-02-03 20:07:41 +01:00
import { Config } from "@jest/types"
const preset = require("ts-jest/jest-preset")
2023-02-03 20:08:45 +01:00
const baseConfig: Config.InitialProjectOptions = {
...preset,
preset: "@trendyol/jest-testcontainers",
setupFiles: ["./tests/jestEnv.ts"],
setupFilesAfterEnv: ["./tests/jestSetup.ts"],
transform: {
"^.+\\.ts?$": "@swc/jest",
},
moduleNameMapper: {
2023-02-01 12:02:29 +01:00
"@budibase/types": "<rootDir>/../types/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"],
}
export default config