forked from mwootendev/ngx-translate-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
44 lines (44 loc) · 1.36 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
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.json');
module.exports = {
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': [
'jest-preset-angular',
{
tsconfig: './projects/testing/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
diagnostics: {
ignoreCodes: [151001]
}
}
]
},
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/setupJest.ts'],
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
moduleFileExtensions: ['ts', 'html', 'js', 'json', 'mjs'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', 'contract.spec.ts$', 'comp.spec.ts$'],
silent: true,
moduleDirectories: ['node_modules', '<rootDir>'],
roots: ['<rootDir>/projects/testing/src'],
collectCoverage: true,
collectCoverageFrom: [
'**/*.ts',
'!**/node_modules/**',
'!**/interfaces/**',
'!**/*.spec.ts',
'!**/*.module.ts',
'!**/polyfills.ts',
'!**/main.ts',
'!**/index.ts',
'!**/src/environments/**',
'!**/*.d.ts',
'!**/public-api.ts'
],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/projects/testing/'
}),
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
coverageDirectory: 'coverage',
coverageReporters: ['json', 'lcov', 'clover', 'html', 'text']
};