-
Notifications
You must be signed in to change notification settings - Fork 7
/
jest.config.ts
70 lines (58 loc) · 1.68 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import type { JestConfigWithTsJest } from 'ts-jest'
export default <JestConfigWithTsJest> {
// preset: "ts-jest",
// resolver: "ts-jest-resolver",
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: [
"src/**/*.{js,ts}",
"!src/**/*.d.ts",
"!src/**/index.ts",
"!src/**/interfaces/*.ts",
],
// The directory where Jest should output its coverage files
// coverageDirectory: "coverage",
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
// "json",
// "json-summary",
"text",
"lcov",
// "clover"
],
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
// lines: 90,
},
},
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
"^.+\\.ts$": [
"ts-jest",
{
tsconfig: "tsconfig.json",
useESM: true,
}
],
},
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
modulePathIgnorePatterns: [
"<rootDir>/dist/",
],
// The test environment that will be used for testing
testEnvironment: "node",
// The glob patterns Jest uses to detect test files
testMatch: [
"**/?(*.)+(spec|test).[tj]s?(x)",
],
setupFilesAfterEnv: [
"<rootDir>/__tests__/jest.setup.ts",
],
};