forked from geonetwork/geonetwork-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.preset.js
39 lines (37 loc) · 968 Bytes
/
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
39
const nxPreset = require('@nx/jest/preset').default
const npmDependenciesOnlyInEsm = [
'color-*',
'ol',
'@mapbox',
'@geospatial-sdk',
'@camptocamp/ogc-client',
'node-fetch',
'data-uri-to-buffer',
'fetch-blob',
'formdata-polyfill',
'.*.mjs',
]
module.exports = {
...nxPreset,
coverageReporters: ['text'],
setupFiles: ['jest-canvas-mock'],
transformIgnorePatterns: [
`node_modules/(?!(${npmDependenciesOnlyInEsm.join('|')}))`,
],
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
isolatedModules: true,
},
],
},
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
}