-
-
Notifications
You must be signed in to change notification settings - Fork 140
/
jest.conf.js
30 lines (28 loc) · 1.1 KB
/
jest.conf.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
const { pathsToModuleNameMapper } = require('ts-jest');
const {
compilerOptions: { paths = {}, baseUrl = './' }
} = require('./tsconfig.json');
const environment = require('./webpack/environment');
module.exports = {
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$|dayjs/esm)'],
testRunner: 'jest-jasmine2',
setupFiles: ['jest-date-mock'],
cacheDirectory: '<rootDir>/target/jest-cache',
coverageDirectory: '<rootDir>/target/test-results/',
globals: {
...environment,
'ts-jest': {
stringifyContentPathRegex: '\\.html$',
tsconfig: '<rootDir>/tsconfig.spec.json'
}
},
coveragePathIgnorePatterns: ['<rootDir>/src/test/javascript'],
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: `<rootDir>/${baseUrl}/` }),
reporters: ['default', ['jest-junit', { outputDirectory: './target/test-results/', outputName: 'TESTS-results-jest.xml' }]],
testResultsProcessor: 'jest-sonar-reporter',
testMatch: ['<rootDir>/src/test/javascript/spec/**/@(*.)@(spec.ts)'],
testEnvironmentOptions: {
url: 'http://localhost/'
},
roots: ['<rootDir>', `<rootDir>/${baseUrl}`]
};