-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.ts
More file actions
38 lines (35 loc) · 994 Bytes
/
jest.config.ts
File metadata and controls
38 lines (35 loc) · 994 Bytes
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
34
35
36
37
38
import { JestConfigWithTsJest } from "ts-jest";
// Jest config file docs: https://jestjs.io/docs/configuration
const jestConfig: JestConfigWithTsJest = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: [
"src/**/*.{js,ts}",
"!function/**", // <-- TS build target dir
"!**/*.d.ts",
"!**/node_modules/**",
"!**/__tests__/**"
],
coverageDirectory: "coverage",
extensionsToTreatAsEsm: [".ts"],
globalSetup: "<rootDir>/src/__tests__/globalSetup.cjs",
moduleFileExtensions: ["ts", "js", "cts", "cjs", "json"],
preset: "ts-jest/presets/js-with-ts-esm",
rootDir: "./",
setupFiles: ["dotenv/config"],
testEnvironment: "node",
testMatch: ["<rootDir>/src/**/*.test.[tj]s"],
testTimeout: 15000, // 15s
transform: {
"^.+\\.[tj]s$": [
"ts-jest",
{
tsconfig: "tsconfig.json",
useESM: true
}
]
},
transformIgnorePatterns: ["<rootDir>/node_modules/"],
verbose: true
};
export default jestConfig;