-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.cjs
39 lines (38 loc) · 1.1 KB
/
jest.config.cjs
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
// const { pathsToModuleNameMapper } = require('ts-jest');
// const { compilerOptions } = require('./tsconfig-base');
module.exports = {
preset: 'ts-jest',
testMatch: [ "**/__tests__/**/*.ts", "**/?(*.)+(spec|test).ts", "**/tests/**/*.ts"],
testEnvironment: 'node',
transform: { // dp
"^.+\\.(ts|tsx)$": "ts-jest",
},
coverageDirectory: 'coverage',
modulePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/src/server.ts', '<rootDir>/src/worker.ts'],
verbose: true,
coverageReporters: ['html'],
collectCoverageFrom: [
'src/**/*.ts',
'!**/node_modules/**',
'!**/vendor/**',
],
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
},
globals: {
"ts-jest": {
tsconfig: "tsconfig-base.json",
},
},
moduleNameMapper: {
"@eolo/(.*)": "<rootDir>/src/$1",
"@eolo-types/(.*)": "<rootDir>/types/$1"
},
// This doesn't work because require('./tsconfig-base') doesn't recognize comments in JSON files
// moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths , { prefix: '<rootDir>/' } ),
};