-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjest.config.js
More file actions
35 lines (34 loc) · 1.23 KB
/
jest.config.js
File metadata and controls
35 lines (34 loc) · 1.23 KB
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
const { resolve } = require('path');
const { modules } = require('./config/modules');
module.exports = {
notify: true,
rootDir: resolve(),
testURL: 'http://localhost/',
testRegex: '/*.test.js$',
collectCoverage: true,
coverageReporters: ['lcov', 'text-summary'],
coverageDirectory: '__tests__/coverage',
collectCoverageFrom: modules.map(module => `src/${module}/**/*.{js,jsx}`),
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
},
// https://github.com/facebook/jest/issues/2838
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/config/tests/mediaFileTransformer.js',
},
// https://github.com/akiran/react-slick#test-setup
setupFiles: ['<rootDir>/config/tests/test-setup.js'],
// https://github.com/facebook/create-react-app/issues/1909
moduleDirectories: ['node_modules'],
modulePathIgnorePatterns: ['/modules/'],
moduleNameMapper: {
'^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/config/tests/mocks/file.mock.js',
'^.+\\.s?css$': '<rootDir>/config/tests/mocks/style.mock.js',
},
};