forked from RedHatInsights/frontend-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
56 lines (54 loc) · 1.52 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
49
50
51
52
53
54
55
56
// Sync object
/** @type {import('jest').Config} */
const config = {
verbose: true,
coverageDirectory: './coverage/',
collectCoverage: true,
projects: [
'<rootDir>',
{
testMatch: ['<rootDir>/packages/*'],
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: './tsconfig.test.json',
},
],
},
collectCoverageFrom: ['<rootDir>/packages/**/src/**/*.js', '<rootDir>/packages/**/src/**/*.ts', '<rootDir>/packages/**/src/**/*.tsx'],
},
],
transformIgnorePatterns: [
'node_modules/(?!uuid)',
// Uncomment the below line if you face any errors with jest
// '/node_modules/(?!@redhat-cloud-services)',
],
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',
},
testEnvironmentOptions: {
url: 'http://localhost:5000/',
},
globalSetup: '<rootDir>/config/globalSetup.js',
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: './tsconfig.test.json',
},
],
},
};
module.exports = config;