-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
69 lines (68 loc) · 1.33 KB
/
jest.config.js
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
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
const { pathsToModuleNameMapper } = require('ts-jest/utils')
// eslint-disable-next-line import/extensions
const { compilerOptions } = require('./tsconfig.json')
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
bail: 1,
clearMocks: true,
collectCoverage: true,
coverageDirectory: 'coverage',
testTimeout: 10000,
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>' }),
modulePathIgnorePatterns: [
'node_modules',
'dist',
'coverage',
'docker',
'logs'
],
moduleDirectories: [
'<rootDir>/src',
'node_modules'
],
coveragePathIgnorePatterns: [
'node_modules',
'dist',
'coverage',
'docker',
'logs',
'swagger*',
'environment.ts',
'application.ts',
'logger.ts',
'tests'
],
coverageReporters: [
'text',
'cobertura',
'html',
'lcov'
],
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
statements: 90
}
},
reporters: [
'default',
'jest-junit',
'jest-html-reporters'
],
testResultsProcessor: 'jest-sonar-reporter',
testMatch: [
'**/tests/**/*.(test|spec).+(ts)'
],
moduleFileExtensions: [
'ts',
'tsx',
'js',
'jsx',
'json',
'node'
]
}