-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
38 lines (37 loc) · 1.23 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
require('dotenv').config()
const { compilerOptions } = require('./tsconfig.json')
const { pathsToModuleNameMapper } = require('ts-jest')
module.exports = {
bail: 1,
clearMocks: true,
coverageProvider: 'babel',
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: ['coverage', 'node_modules'],
collectCoverageFrom: [
'src/functions/**/*',
'src/infra/gateways/jwt.ts',
],
coverageReporters: ['json', 'text', 'lcov', 'clover'],
coverageThreshold: {
global: {
branches: 5,
functions: 5,
lines: 5,
statements: 5,
},
},
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['js', 'json', 'ts', 'node'],
coveragePathIgnorePatterns: [
'<rootDir>/src/domain/helpers'
],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>',
}),
transform: {
'.+\\.ts$': 'ts-jest',
},
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/test/prismaMock.ts'],
}