-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
47 lines (47 loc) · 1.53 KB
/
jest.config.js
File metadata and controls
47 lines (47 loc) · 1.53 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
36
37
38
39
40
41
42
43
44
45
46
47
module.exports = {
transform: {
'\\.yaml$': 'yaml-jest',
'\\.jsx?$': 'babel-jest',
},
transformIgnorePatterns: [
'node_modules/(?!(@scorum/theme-bootstrap)/)',
],
// Test match mask
testMatch: ['<rootDir>/src/**/?(*.)test.js?(x)'],
// Different handlers for file extensions
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|svg)$': '<rootDir>/resources/jest/resource-mock.js',
'\\.(css|scss)$': '<rootDir>/resources/jest/resource-mock.js',
},
// This custom js module is used to set up things before jest runs tests, e.g. provide enzyme tools into tests
setupFiles: ['<rootDir>/resources/jest/setup.js'],
// Providing custom snapshot serializer for most comfortable use
snapshotSerializers: [
'<rootDir>/node_modules/enzyme-to-json/serializer',
],
modulePaths: ['<rootDir>/'],
// Cache settings: we force jest storing it's cache inside project to simplify cleaning
cacheDirectory: '<rootDir>/.etmp',
// Coverage settings
coverageDirectory: '<rootDir>/reports/coverage',
coveragePathIgnorePatterns: [
'<rootDir>/node_modules',
'<rootDir>/src/components/icons',
'<rootDir>/src/translations',
'<rootDir>/src/helpers/calling-codes',
'<rootDir>/src/components/form/medium-editor-wrapper/config',
'<rootDir>/src/helpers/medium-editor',
'<rootDir>/src/types',
'test-data',
],
coverageThreshold: {
global: {
branches: 65,
functions: 70,
lines: 80,
statements: 80,
},
},
// test url to simulate window.location
testURL: 'https://blog.scorum.com',
};