katello/jest.config.js @ master
cb7a2632 | John Mitsch | const { foremanLocation, foremanRelativePath } = require('@theforeman/find-foreman')
|
|
cb8ed4df | John Mitsch | const foremanReactRelative = 'webpack/assets/javascripts/react_app';
|
|
243881b4 | John Mitsch | const foremanFull = foremanLocation();
|
|
const foremanReactFull = foremanRelativePath(foremanReactRelative);
|
|||
cb8ed4df | John Mitsch | ||
// Jest configuration
|
|||
module.exports = {
|
|||
831260db | Andrew | logHeapUsage: true,
|
|
maxWorkers: 2,
|
|||
cb8ed4df | John Mitsch | testURL: 'http://localhost/',
|
|
setupFiles: [
|
|||
'./webpack/test_setup.js',
|
|||
],
|
|||
setupFilesAfterEnv: [
|
|||
'./webpack/global_test_setup.js',
|
|||
44f71201 | John Mitsch | '@testing-library/jest-dom'
|
|
cb8ed4df | John Mitsch | ],
|
|
testPathIgnorePatterns: [
|
|||
'/node_modules/',
|
|||
'<rootDir>/foreman/',
|
|||
'<rootDir>/.+fixtures.+',
|
|||
'<rootDir>/engines',
|
|||
],
|
|||
moduleDirectories: [
|
|||
243881b4 | John Mitsch | `${foremanFull}/node_modules`,
|
|
`${foremanFull}/node_modules/@theforeman/vendor-core/node_modules`,
|
|||
cb8ed4df | John Mitsch | 'node_modules',
|
|
'webpack/test-utils',
|
|||
],
|
|||
modulePathIgnorePatterns: [
|
|||
'<rootDir>/foreman/',
|
|||
],
|
|||
moduleNameMapper: {
|
|||
'^.+\\.(css|scss)$': 'identity-obj-proxy',
|
|||
243881b4 | John Mitsch | '^foremanReact(.*)$': `${foremanReactFull}/$1`,
|
|
cb8ed4df | John Mitsch | },
|
|
};
|