generated from rpidanny/typescript-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
52 lines (50 loc) · 1.25 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
import { defaults } from 'jest-config'
import type { JestConfigWithTsJest } from 'ts-jest'
const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/default',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: defaults.testRegex,
transform: {
'^.+\\.(t|j)s$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
},
],
},
testEnvironment: 'jest-environment-node',
testPathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/tmp/',
'<rootDir>/node_modules/',
'<rootDir>/local_tests/',
],
testTimeout: 20_000,
setupFiles: ['<rootDir>/test/setup-test.ts'],
// collectCoverageFrom: ['**/*.(t|j)s'],
collectCoverageFrom: ['<rootDir>/src/**/*.(t|j)s'],
coverageDirectory: '<rootDir>/coverage',
coverageReporters: [['lcov', { projectRoot: './' }], 'text'],
coveragePathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/test/',
'<rootDir>/dist/',
'<rootDir>/tmp/',
'<rootDir>/local_tests/',
'<rootDir>/coverage/',
],
coverageThreshold: {
global: {
statements: 87,
branches: 63,
functions: 84,
lines: 90,
},
},
}
export default config