-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
jest.config.js
executable file
·67 lines (61 loc) · 1.84 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
const { defaults } = require('jest-config')
const glob = require('glob')
const setupFiles = glob
.sync('**/testsUtils/setupFile.ts')
.map((path) => `<rootDir>/${path}`)
const defaultConfig = {
transform: {
'^.+\\.(j|t)s$': ['ts-jest', {}],
},
moduleNameMapper: {
'^lodash-es$': 'lodash',
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testEnvironment: 'node',
testMatch: [
'<rootDir>/apps/**/__tests__/**/*.(test).((j|t)s)',
'<rootDir>/libs/**/__tests__/**/*.(test).((j|t)s)',
],
resetMocks: true,
modulePathIgnorePatterns: ['<rootDir>/.*/\\.dist/'],
passWithNoTests: true,
coverageDirectory: '<rootDir>/.test-runs/unit',
collectCoverage: false,
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts'],
collectCoverageFrom: ['<rootDir>/**/src/**/*.ts'],
coveragePathIgnorePatterns: [
'/__tests__/',
'/__mocks__/',
'/__component_tests__/',
],
setupFiles: setupFiles,
}
module.exports = defaultConfig
// import { defaults } from 'jest-config'
// const defaultConfig = {
// testEnvironment: 'node',
// transform: {
// '^.+\\.(j|t)s$': ['ts-jest', { useEsm: true }],
// },
// moduleNameMapper: {
// '^lodash-es$': 'lodash',
// '^(\\.{1,2}/.*)\\.js$': '$1',
// },
// extensionsToTreatAsEsm: ['.ts'],
// testMatch: ['<rootDir>/src/**/__tests__/**/*.(test).((j|t)s)'],
// resetMocks: true,
// modulePathIgnorePatterns: ['<rootDir>/\\.dist/'],
// passWithNoTests: false,
// coverageDirectory: '<rootDir>/.test-runs/unit',
// collectCoverage: true,
// moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts'],
// collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
// coveragePathIgnorePatterns: [
// '/__tests__/',
// '/__mocks__/',
// '/__component_tests__/',
// 'src/server/server.ts',
// 'src/server/app.ts',
// ],
// }
// export default defaultConfig