-
Notifications
You must be signed in to change notification settings - Fork 23
/
jest.config.js
47 lines (45 loc) · 1.55 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
// Sync object
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
verbose: true,
coverageDirectory: './coverage/',
collectCoverage: true,
transformIgnorePatterns: [
'node_modules/(?!@patternfly|@data-driven-forms)',
// Uncomment the below line if you face any errors with jest
// '/node_modules/(?!@redhat-cloud-services)',
],
collectCoverageFrom: [
'<rootDir>/packages/**/src/**/*.js',
'!<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',
testEnvironmentOptions: {
url: 'http://localhost:5000/',
},
setupFiles: [ './jest.setup.js' ],
roots: [ '<rootDir>/packages/' ],
// modulePathIgnorePatterns: ['<rootDir>/packages/create-crc-app/templates', '<rootDir>/packages/docs/.cache'],
modulePathIgnorePatterns: [
'<rootDir>/packages/*.*/dist/*.*',
'<rootDir>/packages/*.*/public/*.*',
'<rootDir>/packages/*.*/.cache/*.*'
],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'^lodash-es$': 'lodash',
customReact: 'react',
reactRedux: 'react-redux',
PFReactCore: '@patternfly/react-core',
PFReactTable: '@patternfly/react-table',
},
globalSetup: '<rootDir>/config/globalSetup.js',
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': [ 'ts-jest', { tsconfig: './packages/module/tsconfig.json', } ],
},
};