forked from RedHatInsights/frontend-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
48 lines (45 loc) · 1.47 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
45
46
47
48
// Sync object
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
verbose: true,
coverageDirectory: './coverage/',
collectCoverage: true,
transformIgnorePatterns: [
'node_modules/(?!@patternfly|@data-driven-forms|lodash-es|@openshift)',
// Uncomment the below line if you face any errors with jest
// '/node_modules/(?!@redhat-cloud-services)',
],
collectCoverageFrom: [
'<rootDir>/packages/**/src/**/*.js',
'<rootDir>/packages/**/src/**/*.ts',
'<rootDir>/packages/**/src/**/*.tsx',
'!<rootDir>/packages/**/stories/*',
'!<rootDir>/packages/**/index.js',
'!<rootDir>/packages/**/*{c|C}ontext*.js',
'!<rootDir>/packages/components/src/Components/Table/*',
],
setupFilesAfterEnv: ['<rootDir>/config/setupTests.js', 'jest-canvas-mock'],
testEnvironment: 'jsdom',
roots: ['<rootDir>/packages/'],
modulePathIgnorePatterns: ['<rootDir>/packages/create-crc-app/templates', '<rootDir>/packages/docs/.cache'],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'^lodash-es$': 'lodash',
customReact: 'react',
reactRedux: 'react-redux',
PFReactCore: '@patternfly/react-core',
PFReactTable: '@patternfly/react-table',
},
testURL: 'http://localhost:5000/',
globalSetup: '<rootDir>/config/globalSetup.js',
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest',
},
globals: {
'ts-jest': {
tsconfig: './tsconfig.json',
},
},
};
module.exports = config;