summaryrefslogtreecommitdiffstats
path: root/public/jest.config.js
blob: e1836c07b9aa5f888ac718fb42985c69caf078e9 (plain)
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
module.exports = {
  // mapCoverage: true,
  globals: {
    __TS_CONFIG__: {
      target: 'es6',
      module: 'commonjs',
      moduleResolution: 'node'
    },
    'ts-jest': {
      tsConfigFile: 'src/tsconfig.spec.json'
    },
    __TRANSFORM_HTML__: true
  },
  testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|js)$',
  setupTestFrameworkScriptFile: '<rootDir>/src/setupJest.ts',
  transform: {
    '^.+\\.(ts|html)$':
      '<rootDir>/node_modules/jest-preset-angular/preprocessor.js'
  },
  transformIgnorePatterns: ['node_modules/(?!@ngrx)'],
  collectCoverageFrom: [
    'src/app/module/**/*.{ts}',
    '!src/app/*.{ts}',
    '!src/app/**/*.{js}',
    '!src/app/environment/*.{ts}',
    '!src/app/language/*.{ts}',
    '!src/app/**/*.module.{ts}',
    '!src/app/**/*.interface.{ts}',
    '!src/app/**/*.state.{ts}',
    '!src/app/**/*.entity.{ts}'
  ],
  moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
  testPathIgnorePatterns: ['/node_modules/', '/dist/', 'src/app/*.{js}'],
  testResultsProcessor: 'jest-sonar-reporter',
  moduleNameMapper: {
    'app/(.*)': '<rootDir>/src/app/$1',
    '@common/(.*)': '<rootDir>/src/app/common/$1'
  }
};