forked from fga-eps-mds/2023.2-PrintGo-FrontEnd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
32 lines (29 loc) · 1017 Bytes
/
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
const isCoverageEnabled = process.argv.includes('--coverage');
module.exports = {
setupFilesAfterEnv: ['./src/setupTests.js'],
testMatch: ["**/__tests__/**/*.js", "**/?(*.)+(spec|test).js"],
testPathIgnorePatterns: ["/node_modules/"],
transform: {
"^.+\\.(js|jsx)$": "babel-jest",
"^.+\\.svg$": "<rootDir>/fileTransform.js", // Adicione esta linha
},
moduleFileExtensions: ["js", "json", "jsx", "node"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"\\.(css|less|scss)$": "identity-obj-proxy",
'^axios$': require.resolve('axios'),
},
testEnvironment: "jsdom",
collectCoverage: isCoverageEnabled,
collectCoverageFrom: isCoverageEnabled ? ['src/**/*.{js,jsx}'] : [],
reporters: [
'default',
[
'jest-sonar',
{
outputDirectory: 'reports',
outputName: 'sonar-report.xml'
}
]
]
};