-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
35 lines (32 loc) · 1.01 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
const {pathsToModuleNameMapper} = require('ts-jest')
// In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
// which contains the path mapping (ie the `compilerOptions.paths` option):
const {compilerOptions} = require('./tsconfig.json')
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: [
"**/__tests__/**/*.ts?(x)",
"**/?(*.)+(spec|test).ts?(x)"
],
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
coverageDirectory: 'coverage',
coverageProvider: 'v8',
coverageReporters: [
'json',
'text',
'lcov',
'clover',
],
collectCoverageFrom: [
"src/**/*.ts",
"!src/**/*.{dto,module}.ts"
],
coveragePathIgnorePatterns: [
"src/core/.*\\.ts",
"src/server.ts",
"src/application.ts",
]
};