2020-11-23 09:03:12 +00:00
|
|
|
// For a detailed explanation regarding each configuration property, visit:
|
|
|
|
// https://jestjs.io/docs/en/configuration.html
|
2023-01-23 14:16:42 +00:00
|
|
|
/* eslint max-len: ["error", { "code": 150 }]*/
|
2024-02-02 13:04:20 +00:00
|
|
|
const cpus = require('os').cpus().length;
|
2024-02-19 07:45:43 +00:00
|
|
|
console.log('cpus: ', cpus);
|
|
|
|
const maxCpus = Math.floor(cpus / 4);
|
|
|
|
console.log('maxCpus: ', maxCpus);
|
2020-11-23 09:03:12 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: 'front end',
|
|
|
|
displayName: {
|
|
|
|
name: 'Front end',
|
|
|
|
color: 'cyan',
|
|
|
|
},
|
|
|
|
testEnvironment: 'jsdom',
|
|
|
|
setupFilesAfterEnv: [
|
2024-02-09 08:23:00 +00:00
|
|
|
'./front/jest-setup.js'
|
2020-11-23 09:03:12 +00:00
|
|
|
],
|
2024-02-02 13:04:20 +00:00
|
|
|
maxWorkers: maxCpus,
|
2020-11-23 09:03:12 +00:00
|
|
|
testMatch: [
|
|
|
|
'**/front/**/*.spec.js',
|
|
|
|
'**/print/**/*.spec.js',
|
|
|
|
'loopback/**/*.spec.js',
|
|
|
|
'modules/*/back/**/*.spec.js'
|
|
|
|
],
|
|
|
|
testPathIgnorePatterns: [
|
|
|
|
'/node_modules/'
|
|
|
|
],
|
|
|
|
coveragePathIgnorePatterns: [
|
|
|
|
'/node_modules/',
|
|
|
|
'.spec.js'
|
|
|
|
],
|
|
|
|
moduleDirectories: [
|
|
|
|
`front`,
|
|
|
|
`modules`,
|
|
|
|
`front/node_modules`,
|
|
|
|
`node_modules`,
|
|
|
|
`print`
|
|
|
|
],
|
|
|
|
moduleFileExtensions: [
|
|
|
|
'js',
|
|
|
|
],
|
|
|
|
moduleNameMapper: {
|
|
|
|
'\\.(css|scss)$': 'identity-obj-proxy',
|
2024-02-09 08:23:00 +00:00
|
|
|
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/front/jest-mock.js',
|
2020-11-23 09:03:12 +00:00
|
|
|
},
|
|
|
|
testURL: 'http://localhost',
|
|
|
|
verbose: false,
|
|
|
|
errorOnDeprecated: true,
|
|
|
|
restoreMocks: true,
|
|
|
|
timers: 'real',
|
|
|
|
transform: {
|
|
|
|
'^.+\\.js?$': 'babel-jest',
|
|
|
|
'^.+\\.html$': 'html-loader-jest'
|
|
|
|
},
|
2022-05-13 07:02:33 +00:00
|
|
|
reporters: ['default', 'jest-junit']
|
2020-11-23 09:03:12 +00:00
|
|
|
};
|
|
|
|
|