-
Notifications
You must be signed in to change notification settings - Fork 297
/
jest.config.js
39 lines (37 loc) · 1.03 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
const { foremanLocation, foremanRelativePath } = require('@theforeman/find-foreman')
const foremanReactRelative = 'webpack/assets/javascripts/react_app';
const foremanFull = foremanLocation();
const foremanReactFull = foremanRelativePath(foremanReactRelative);
// Jest configuration
module.exports = {
logHeapUsage: true,
maxWorkers: 2,
testURL: 'http://localhost/',
setupFiles: [
'./webpack/test_setup.js',
],
setupFilesAfterEnv: [
'./webpack/global_test_setup.js',
'@testing-library/jest-dom'
],
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/foreman/',
'<rootDir>/.+fixtures.+',
'<rootDir>/engines',
'<rootDir>/vendor/',
],
moduleDirectories: [
`${foremanFull}/node_modules`,
`${foremanFull}/node_modules/@theforeman/vendor-core/node_modules`,
'node_modules',
'webpack/test-utils',
],
modulePathIgnorePatterns: [
'<rootDir>/foreman/',
],
moduleNameMapper: {
'^.+\\.(css|scss)$': 'identity-obj-proxy',
'^foremanReact(.*)$': `${foremanReactFull}/$1`,
},
};