-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.cjs
30 lines (29 loc) · 940 Bytes
/
jest.config.cjs
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
module.exports = {
testEnvironment: 'jest-environment-jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.ts(x)',
'!src/**/*.stories.tsx',
'!**/*.d.ts',
'!**/styles.ts',
'!**/context/**',
'!src/App.tsx',
'!src/main.tsx',
'!**/node_modules/**',
'!<rootDir>/*.config.js',
'!<rootDir>/coverage/**',
],
moduleDirectories: ['node_modules', '<rootDir>/'],
testPathIgnorePatterns: ['/node_modules/'],
moduleNameMapper: {
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/.jest/mocks/fileMock.ts',
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
},
transform: {
'\\.[jt]sx?$': 'babel-jest',
},
}
// Configuração do Jest e React Testing Library com React.js ( versão com Babel )
// instalação abaixo:
// npm install --save-dev jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom @types/jest