-
Notifications
You must be signed in to change notification settings - Fork 191
/
jest.config.js
50 lines (48 loc) · 1.58 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
const setTZ = require('set-tz')
setTZ('America/New_York')
module.exports = {
transform: {
'^.+\\.jsx?$': `<rootDir>/jest-preprocess.js`,
},
reporters: ['default', 'jest-junit'],
moduleNameMapper: {
'.+\\.(css|styl|less|sass|scss)$': `identity-obj-proxy`,
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `<rootDir>/__mocks__/file-mock.js`,
'~plugins/(.*)$': '<rootDir>/plugins/$1',
'~components/(.*)$': '<rootDir>/src/components/$1',
'~context/(.*)$': '<rootDir>/src/context/$1',
'~data/(.*)$': '<rootDir>/src/data/$1',
'~images/(.*)$': '<rootDir>/src/images/$1',
'~pages/(.*)$': '<rootDir>/src/pages/$1',
'~scss/(.*)$': '<rootDir>/src/scss/$1',
'~templates/(.*)$': '<rootDir>/src/templates/$1',
'~utilities/(.*)$': '<rootDir>/src/utilities/$1',
},
testPathIgnorePatterns: [
`node_modules`,
`\\.cache`,
`<rootDir>.*/public`,
'./src/__tests__/build/index.js',
'./src/__tests__/api/index.js',
],
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
globals: {
__PATH_PREFIX__: ``,
},
testURL: `http://localhost`,
setupFiles: [`<rootDir>/loadershim.js`],
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
collectCoverageFrom: [
'./src/**/*.js',
'!./src/components/pages/**/*.js',
'!./src/components/charts/**/*.js',
'!./src/components/common/**/*.js',
'!./src/components/layout/**/*.js',
'!./src/pages/**/*.js',
'!./src/templates/**/*.js',
'!./src/stories/**',
'!./src/__tests__/**',
'!**/node_modules/**',
'!./build/**',
],
}