-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
34 lines (28 loc) · 1008 Bytes
/
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
const { pathsToModuleNameMapper } = require('ts-jest/utils')
const { compilerOptions } = require('./tsconfig.json')
/** @typedef {import('ts-jest')} */
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
collectCoverage : process.env.NODE_ENV === 'test',
preset : 'ts-jest/presets/js-with-ts',
moduleFileExtensions : ['ts', 'js', 'json', 'node'],
reporters : ['default'],
roots : ['<rootDir>/src', '<rootDir>/test'],
testEnvironment : 'node',
testRegex : '((\\.|/)(test|spec))\\.tsx?$',
verbose : true,
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/types/**/*',
'!<rootDir>/src/bin/cli-service.ts',
'!<rootDir>/src/index.ts',
],
displayName: {
name : require('./package.json').name,
color : 'blue',
},
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix : '<rootDir>/' }),
},
}
module.exports = config