forked from kriasoft/react-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
95 lines (79 loc) · 3.63 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Jest configuration
// https://facebook.github.io/jest/docs/en/configuration.html
module.exports = {
// Modules can be explicitly auto-mocked using jest.mock(moduleName).
// https://facebook.github.io/jest/docs/en/configuration.html#automock-boolean
automock: false, // [boolean]
// Respect Browserify's "browser" field in package.json when resolving modules.
// https://facebook.github.io/jest/docs/en/configuration.html#browser-boolean
browser: false, // [boolean]
// This config option can be used here to have Jest stop running tests after the first failure.
// https://facebook.github.io/jest/docs/en/configuration.html#bail-boolean
bail: false, // [boolean]
// The directory where Jest should store its cached dependency information.
// https://facebook.github.io/jest/docs/en/configuration.html#cachedirectory-string
// cacheDirectory: '/tmp/<path>', // [string]
// Indicates whether the coverage information should be collected while executing the test.
// Because this retrofits all executed files with coverage collection statements,
// it may significantly slow down your tests.
// https://facebook.github.io/jest/docs/en/configuration.html#collectcoverage-boolean
// collectCoverage: false, // [boolean]
// https://facebook.github.io/jest/docs/en/configuration.html#collectcoveragefrom-array
collectCoverageFrom: [
'src/**/*.{js,jsx}',
'!**/node_modules/**',
'!**/vendor/**',
],
// https://facebook.github.io/jest/docs/en/configuration.html#coveragedirectory-string
coverageDirectory: '<rootDir>/coverage', // [string]
// coveragePathIgnorePatterns: // [array<string>]
// coverageReporters: [], // [array<string>]
// coverageThreshold: {}, // [object]
globals: {
__DEV__: true,
},
// https://facebook.github.io/jest/docs/en/configuration.html#mapcoverage-boolean
// mapCoverage: false, // [boolean]
// The default extensions Jest will look for.
// https://facebook.github.io/jest/docs/en/configuration.html#modulefileextensions-array-string
moduleFileExtensions: ['js', 'json', 'jsx', 'node'],
// Allow absolute paths in imports, e.g. import Button from 'components/Button'
// Keep in sync with, .eslintrc, jest.config.js and styleguide.config.js
moduleDirectories: ['node_modules', 'src'], // [array<string>]
// A map from regular expressions to module names that allow to stub out resources,
// like images or styles with a single module.
moduleNameMapper: {
'\\.(css|less|styl|scss|sass|sss)$': 'identity-obj-proxy',
},
// modulePathIgnorePatterns: // [array<string>]
// modulePaths: // [array<string>]
// notify: false, // [boolean]
// preset: // [string]
// projects: // [array<string>]
// clearMocks: // [boolean]
// reporters: // [array<moduleName | [moduleName, options]>]
// resetMocks: // [boolean]
// resetModules: // [boolean]
// resolver: // [string]
// rootDir: // [string]
// roots: // [array<string>]
// setupFiles: // [array]
setupFilesAfterEnv: ['<rootDir>/test/setupTestFramework.js'], // [array<string>]
// snapshotSerializers: // [array<string>]
// testEnvironment: // [string]
// testMatch: // [array<string>]
// testPathIgnorePatterns: // [array<string>]
// testRegex: // [string]
// testResultsProcessor: // [string]
// testRunner: // [string]
testURL: 'http://localhost/',
// timers: // [string]
transform: {
'\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest',
'^(?!.*\\.(js|jsx|json|css|less|styl|scss|sass|sss)$)':
'<rootDir>/tools/lib/fileTransformer.js',
},
// transformIgnorePatterns: // [array<string>]
// unmockedModulePathPatterns: // [array<string>]
verbose: true, // [boolean]
};