-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
78 lines (68 loc) · 1.91 KB
/
Copy pathjest.config.js
File metadata and controls
78 lines (68 loc) · 1.91 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
69
70
71
72
73
74
75
76
77
78
/**
* Jest Configuration for Aadhat Management App
* @type {import('jest').Config}
*/
module.exports = {
// Use jsdom environment for DOM testing
testEnvironment: 'jsdom',
// Test file patterns
testMatch: [
'**/www/js/__tests__/**/*.test.js',
'**/www/js/**/*.spec.js'
],
// Module file extensions
moduleFileExtensions: ['js', 'json'],
// Transform ES modules with Babel
transform: {
'^.+\\.js$': 'babel-jest'
},
// Module name mapper for path aliases
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/www/js/$1'
},
// Coverage configuration - only collect from testable utility files
collectCoverageFrom: [
'www/js/utils/helpers.js',
'www/js/utils/validator.js',
'www/js/utils/state.js',
// Exclude files that require Firebase, DOM, or Capacitor
'!www/js/__tests__/**',
'!www/js/main.js',
'!www/js/auth/**',
'!www/js/firebase/**',
'!www/js/modules/**',
'!www/js/services/**',
'!www/js/ui/**',
'!www/js/utils/constants.js',
'!www/js/utils/template-loader.js'
],
// Coverage thresholds - only for files we can unit test
coverageThreshold: {
'www/js/utils/helpers.js': {
branches: 35,
functions: 70,
lines: 60,
statements: 60
},
'www/js/utils/validator.js': {
branches: 90,
functions: 85,
lines: 95,
statements: 95
},
'www/js/utils/state.js': {
branches: 100,
functions: 100,
lines: 100,
statements: 100
}
},
// Setup files
setupFilesAfterEnv: [],
// Verbose output
verbose: true,
// Clear mocks between tests
clearMocks: true,
// Restore mocks between tests
restoreMocks: true
};