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

41 lines
940 B
TypeScript
Raw Normal View History

import { Config } from "jest"
const preset = require("ts-jest/jest-preset")
const configSettings = {
...preset,
preset: "@trendyol/jest-testcontainers",
setupFiles: ["./tests/jestEnv.ts"],
setupFilesAfterEnv: ["./tests/jestSetup.ts"],
collectCoverageFrom: ["src/**/*.{js,ts}"],
coverageReporters: ["lcov", "json", "clover"],
transform: {
"^.+\\.ts?$": "@swc/jest",
},
}
2023-01-26 12:38:21 +01:00
if (!process.env.CI) {
// use sources when not in CI
configSettings.moduleNameMapper = {
2023-01-26 12:38:21 +01:00
"@budibase/types": "<rootDir>/../types/src",
}
} else {
console.log("Running tests with compiled dependency sources")
}
const config: Config = {
projects: [
{
...configSettings,
displayName: "sequential test",
testMatch: ["<rootDir>/**/*.seq.spec.[jt]s"],
runner: "jest-serial-runner",
},
{
...configSettings,
testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"],
},
],
}
export default config