-
Notifications
You must be signed in to change notification settings - Fork 21
/
jest.config.js
43 lines (42 loc) · 1.15 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
36
37
38
39
40
41
42
43
const config = {
testEnvironment: 'jsdom',
modulePaths: [
'<rootDir>',
'<rootDir>/apps/userdashboard/assets/js/a4_candy_userdashboard'
],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg)$': '<rootDir>/__mocks__/fileMock.js',
'(django)': '<rootDir>/__mocks__/djangoMock.js',
'^(\\.\\/ModerationFeedbackForm$|^\\.\\/ModerationFeedback$)': '<rootDir>/__mocks__/customComponentMock.js',
'^(\\.\\/api$)': '<rootDir>/__mocks__/apiMock.js',
'(adhocracy4)': '<rootDir>/__mocks__/a4Mock.js'
},
testMatch: [
'**/*.jest.js',
'**/*.jest.jsx'
],
collectCoverage: true,
collectCoverageFrom: [
'**/*.jsx',
'!**/coverage/**',
'!**/node_modules/**',
'!**/babel.config.js',
'!**/jest.setup.js',
'!**/chrome/**',
'!**/site-packages/adhocracy4/**',
'!static/**'
],
testPathIgnorePatterns: [
'/(.*/site-packages/adhocracy4/.*)/',
'/(static/.*)/'
],
transform: {
'^.+\\.[t|j]sx?$': 'babel-jest'
},
transformIgnorePatterns: [
// transpile all node_modules, not great?
'/node_modules/(?!(.*)/)'
]
}
module.exports = config