-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
68 lines (56 loc) · 1.21 KB
/
jest.config.js
File metadata and controls
68 lines (56 loc) · 1.21 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* Jest Configuration
*
* @see https://jestjs.io/docs/configuration
*/
const defaultConfig = require('@wordpress/scripts/config/jest-unit.config');
module.exports = {
...defaultConfig,
// Test file patterns
testMatch: [
'**/tests/js/**/*.test.js',
'**/tests/**/*.test.js',
'**/?(*.)+(spec|test).js',
],
// Files to ignore
testPathIgnorePatterns: [
'/node_modules/',
'/vendor/',
'/build/',
'/tests/e2e/',
'/.dry-run-backup/',
],
// Setup files
setupFilesAfterEnv: ['<rootDir>/.github/__tests__/setup-tests.js'],
// Coverage configuration
collectCoverageFrom: [
'scripts/dry-run-config.js',
'scripts/generate-plugin.js',
],
coverageDirectory: 'coverage',
coverageReporters: [
'text',
'text-summary',
'html',
'lcov',
'json',
'json-summary',
],
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 5,
statements: 5,
},
},
// Module paths
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/tests/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/tests/__mocks__/fileMock.js',
},
// Transform ES modules from node_modules
transformIgnorePatterns: ['node_modules/(?!(parsel-js)/)'],
// Verbose output
verbose: true,
};