-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathjest.config.js
61 lines (59 loc) · 1.52 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// List of node modules which need to be transformed for jest to work
const esModules = [
/** react-leaflet */
'@?react-leaflet',
/** react-markdown 9.0.1 */
'react-markdown',
'bail',
'comma-separated-tokens',
'decode-named-character-reference',
'devlop/lib/default',
'estree-util-is-identifier-name',
'hast-util-.*',
'html-url-attributes',
'is-plain-obj',
'mdast-util-.*',
'micromark.*',
'property-information',
'remark-.*',
'space-separated-tokens',
'trim-lines',
'trough',
'unified',
'unist-.*',
'vfile-message',
/** react-markdown 8.0.3 */
'vfile'
].join('|')
const config = {
testEnvironment: 'jsdom',
modulePaths: ['<rootDir>'],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg)$': '<rootDir>/__mocks__/fileMock.js',
'(django)': '<rootDir>/__mocks__/djangoMock.js',
'react-flip-move': '<rootDir>/__mocks__/flipmoveMock.js'
},
testMatch: ['**/*.jest.js', '**/*.jest.jsx'],
testPathIgnorePatterns: ['venv/', 'node_modules/', 'build/'],
collectCoverage: true,
collectCoverageFrom: [
'**/*.jsx',
'!**/coverage/**',
'!**/node_modules/**',
'!**/babel.config.js',
'!**/jest.setup.js',
'!**/chrome/**'
],
transform: {
'^.+\\.[t|j]sx?$': 'babel-jest'
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\](?!' +
esModules +
').+\\.(js|jsx|mjs|cjs|ts|tsx)$'
],
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
coverageReporters: ['lcov']
}
module.exports = config