This repository has been archived by the owner on Jun 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
48 lines (39 loc) · 1.72 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
// 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,
// Respect Browserify's "browser" field in package.json when resolving modules.
// https://facebook.github.io/jest/docs/en/configuration.html#browser-boolean
browser: false,
// 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,
// https://facebook.github.io/jest/docs/en/configuration.html#collectcoveragefrom-array
collectCoverageFrom: [
'api/**/*.{js,jsx}',
'app/**/*.{js,jsx}',
'!**/node_modules/**',
'!**/vendor/**',
],
// https://facebook.github.io/jest/docs/en/configuration.html#coveragedirectory-string
coverageDirectory: '<rootDir>/coverage',
globals: {
__DEV__: true,
},
// The default extensions Jest will look for.
// https://facebook.github.io/jest/docs/en/configuration.html#modulefileextensions-array-string
moduleFileExtensions: ['js', 'json', 'jsx', 'node'],
// 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',
},
transform: {
'\\.(js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
'^(?!.*\\.(js|jsx|json|css|less|styl|scss|sass|sss)$)':
'<rootDir>/tools/lib/fileTransformer.js',
},
verbose: true,
};