forked from metriport/metriport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
33 lines (28 loc) · 893 Bytes
/
jest.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as path from "path";
import type { JestConfigWithTsJest } from "ts-jest";
const isE2E = process.env.E2E === "true";
process.env.ENV_TYPE = "dev";
const cwd = process.cwd();
const paths = [cwd, ...(cwd.includes("packages") ? [] : ["packages", "api"])];
const tsconfig = path.resolve(...paths, "tsconfig.dev.json");
const config: JestConfigWithTsJest = {
preset: "ts-jest",
testEnvironment: "node",
verbose: true,
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
testMatch: isE2E
? ["**/__tests__/**/(*.)+(spec|test).e2e.[jt]s?(x)"]
: ["**/__tests__/**/(*.)+(spec|test).[jt]s?(x)"],
globalTeardown: "./src/__tests__/tear-down.ts",
setupFilesAfterEnv: ["./src/__tests__/env-setup.ts"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
// ts-jest configuration goes here
tsconfig,
},
],
},
};
export default config;