generator.client.angular.core.jest.conf.js.mustache Maven / Gradle / Ivy
const { pathsToModuleNameMapper } = require('ts-jest');
const {
compilerOptions: { paths = {}, baseUrl = './' },
} = require('./tsconfig.json');
module.exports = {
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$|dayjs/esm)'],
resolver: 'jest-preset-angular/build/resolvers/ng-jest-resolver.js',
roots: ['', `/${baseUrl}`],
modulePaths: [`/${baseUrl}`],
cacheDirectory: '/{{projectBuildDirectory}}/jest-cache',
coverageDirectory: '/{{projectBuildDirectory}}/test-results/',
coverageThreshold: {
global: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: `/${baseUrl}/` }),
testEnvironmentOptions: {
url: 'https://jestjs.io',
},
testMatch: ['/src/main/webapp/environments/**/@(*.)@(spec.ts)', '/src/main/webapp/app/**/@(*.)@(spec.ts)'],
testResultsProcessor: 'jest-sonar-reporter',
};