-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjest.preset.js
38 lines (38 loc) · 1.05 KB
/
jest.preset.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
const nxPreset = require('@nrwl/jest/preset');
const jestHelpersDir = `${__dirname}/tools/jest-helpers`;
module.exports = {
...nxPreset,
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
resolver: '@nrwl/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],
moduleNameMapper: {
'^.+\\.svg$': `${jestHelpersDir}/svgrMock.js`,
'^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `${jestHelpersDir}/fileMock.js`,
},
collectCoverage: true,
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/{jest.config,gatsby-*}.js',
'!**/*.stories.{ts,tsx}',
'!**/src/{polyfills,main}.{ts,tsx}',
'!**/src/environments/**',
'!**/node_modules/**',
'!**/vendor/**',
'!**/public/**',
'!**/types/**',
],
coverageReporters: ['cobertura', 'html'],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '<rootDir>/reports/junit',
outputName: 'test-report.xml',
},
],
],
};