-
-
Notifications
You must be signed in to change notification settings - Fork 346
Expand file tree
/
Copy pathjest.config.js
More file actions
55 lines (44 loc) · 1.58 KB
/
jest.config.js
File metadata and controls
55 lines (44 loc) · 1.58 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
module.exports = {
// Test environment
testEnvironment: 'jsdom',
// maxWorkers: 2,
// workerIdleMemoryLimit: '2GB',
// Test file patterns
testMatch: ['<rootDir>/test/unit/**/*.spec.js', '<rootDir>/test/integration/**/*.spec.js'],
// Setup files
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
moduleDirectories: ['node_modules', '<rootDir>'],
// Module resolution
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
// Transform files using Babel (Jest-specific config)
transform: {
'^.+\\.js$': [
'babel-jest',
{
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
plugins: ['@babel/plugin-transform-class-properties', '@babel/plugin-transform-private-methods'],
},
],
},
// Ignore
coveragePathIgnorePatterns: ['<rootDir>/src/assets/icons/defaultIcons.js', '<rootDir>/src/langs/.*\\.js$', '<rootDir>/src/hooks/.*\\.js$', '<rootDir>/src/interfaces/.*\\.js$'],
// Collect coverage information
collectCoverageFrom: ['src/**/*.js', '!src/assets/icons/defaultIcons.js', '!src/langs/*.js', '!src/hooks/*.js', '!src/interfaces/*.js', '!src/plugins/index.js', '!src/events.js', '!src/typedef.js'],
// Coverage thresholds
coverageThreshold: {
global: {
statements: 70,
branches: 60,
functions: 80,
lines: 70,
},
},
// Verbose output
verbose: false,
// Force exit after all tests complete.
// The editor uses many setTimeout(fn, 0) callbacks internally (component.deselect, editorInit, history sync, etc.)
// that may still be pending when Jest workers try to exit. These are harmless post-test callbacks.
forceExit: true,
};