-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
71 lines (59 loc) · 2.11 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
62
63
64
65
66
67
68
69
70
71
module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage
// information should be collected
collectCoverageFrom: [
'**/src/**/*.js?(x)',
],
// The directory where Jest should output its coverage files
coverageDirectory: './coverage/',
// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: [
'/node_modules/',
'<rootDir>/src/queries/',
'<rootDir>/src/tests/',
'/(.*\\.)?spec.jsx?',
'/(.*\\.)?stories.jsx?',
// TODO: temporarily disable viz 5 until it is actually desinged and implemented.
'<rootDir>/src/pages/Demand/',
],
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
'json',
'text-summary',
'lcov',
// 'clover',
],
// A map from regular expressions to module names that allow to stub out
// resources with a single module
moduleNameMapper: {
'\\.(s?css|jpg|png)$': '<rootDir>/src/tests/emptyModule.js',
'^react-spring/renderprops$': 'react-spring/renderprops.cjs',
},
// The path to a module that runs some code to configure or set up the testing
// framework before each test
setupFilesAfterEnv: ['<rootDir>/src/tests/setup.js'],
// The glob patterns Jest uses to detect test files
testMatch: [
'**/?(*.)spec.js?(x)',
],
// An array of regexp pattern strings that are matched against all test paths,
// matched tests are skipped
testPathIgnorePatterns: [
'/node_modules/',
'/_template/spec.jsx',
],
// A map from regular expressions to paths to transformers
transform: {
'^.+\\.jsx?$': '<rootDir>/src/tests/transform/babel.js',
'^.+\\.md$': '<rootDir>/src/tests/transform/md.js',
},
// An array of regexp pattern strings that are matched against all source file
// paths, matched files will skip transformation
transformIgnorePatterns: [
'/node_modules/',
],
};