-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
37 lines (35 loc) · 1.01 KB
/
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
34
35
36
37
import type { JestConfigWithTsJest } from "ts-jest";
import { pathsToModuleNameMapper } from "ts-jest";
import { compilerOptions } from "./tsconfig.json";
const jestConfig: JestConfigWithTsJest = {
moduleFileExtensions: ["js", "json", "ts"],
rootDir: "./src",
testRegex: ".*\\.spec\\.ts$",
transform: {
"^.+\\.(t|j)s$": "ts-jest",
},
collectCoverageFrom: [
"**/*.ts",
"!coverage/**",
"!utils/noop.ts",
"!index.ts",
"!app.ts",
"!**/index.ts",
"!dev.ts",
],
coverageDirectory: "../coverage",
testEnvironment: "node",
roots: ["<rootDir>"],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: "<rootDir>/" }),
collectCoverage: false,
coverageThreshold: {
global: {
lines: 0,
branches: 0,
functions: 0,
statements: 0,
},
},
};
export = jestConfig;