-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
35 lines (34 loc) · 1.12 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
let reporterRules = require('./reporter-rules.json')
module.exports = {
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
clearMocks: true,
testMatch: ['<rootDir>/**/*.test.[jt]s?(x)'],
testPathIgnorePatterns: ['/node_modules/', '/build/'],
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs)$': 'babel-jest',
},
transformIgnorePatterns: [
'/node_modules/(?!(lbh-frontend)/)',
'^.+\\.module\\.(css|sass|scss)$',
],
moduleDirectories: ['node_modules', '.'],
moduleNameMapper: {
'^.+\\.(css|scss)$': '<rootDir>/src/styles/__mocks__/styleMock.js',
'^@/components/(.*)$': '<rootDir>/src/components/$1',
'^@/hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@/models/(.*)$': '<rootDir>/src/models/$1',
'^@/pages/(.*)$': '<rootDir>/src/pages/$1',
'^@/root/(.*)$': '<rootDir>/$1',
'^@/styles/(.*)$': '<rootDir>/src/styles/$1',
'^@/utils/(.*)$': '<rootDir>/src/utils/$1',
},
reporters: [
['jest-clean-console-reporter', { rules: reporterRules }],
'@jest/reporters/build/SummaryReporter',
],
}