-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathjest.config.js
More file actions
49 lines (49 loc) · 1.08 KB
/
jest.config.js
File metadata and controls
49 lines (49 loc) · 1.08 KB
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
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts$': ['ts-jest', {
tsconfig: 'tsconfig.test.json',
useESM: true
}]
},
roots: ['<rootDir>/tests'],
testMatch: ['**/unit/**/*.test.ts'],
moduleNameMapper: {
'^@substack-api/(.*)$': '<rootDir>/src/$1',
'^@test/(.*)$': '<rootDir>/tests/$1'
},
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.test.ts'
],
coveragePathIgnorePatterns: [
'/node_modules/',
'/tests/',
'/samples/'
],
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
},
extensionsToTreatAsEsm: ['.ts'],
reporters: [
'default',
['jest-junit', {
outputDirectory: '.',
outputName: 'junit.xml',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
ancestorSeparator: ' › ',
usePathForSuiteName: true
}]
]
}