-
Notifications
You must be signed in to change notification settings - Fork 102
/
jest.preset.js
29 lines (28 loc) · 1.14 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
const nxPreset = require('@nx/jest/preset').default;
const path = require('path');
const setupTestsPath = path.resolve(__dirname, './config/setupTests.js')
module.exports = {
...nxPreset,
testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'^lodash-es$': 'lodash',
customReact: 'react',
reactRedux: 'react-redux',
PFReactCore: '@patternfly/react-core',
PFReactTable: '@patternfly/react-table',
// this needs to be done con link the local packages during jest runtime without the necessity of rebuilding the packages
// this should make local testing more reliable because the packages will not require a rebuild to be tested
"@redhat-cloud-services/frontend-components/(.*)": ["<rootDir>/../../packages/components/src/$1"],
"@redhat-cloud-services/frontend-components-utilities/(.*)": ["<rootDir>/../../packages/utils/src/$1"],
},
transform: {
'^.+\\.tsx?$': ['ts-jest', {
"tsconfig": "<rootDir>/tsconfig.spec.json"
}],
},
transformIgnorePatterns: [
'node_modules/(?!(uuid|p-all|p-map))',
],
setupFilesAfterEnv: [setupTestsPath, 'jest-canvas-mock']
};