-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
106 lines (89 loc) · 2.77 KB
/
Copy pathjest.config.js
File metadata and controls
106 lines (89 loc) · 2.77 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**
* Jest Configuration for AuraGlass Component Library
* Week 5: Testing & Validation Setup - Enhanced
*/
module.exports = {
// Use jsdom for browser-like environment
testEnvironment: 'jsdom',
// Add the project root to the roots
roots: ['<rootDir>'],
// Setup files
setupFilesAfterEnv: [
'@testing-library/jest-dom',
'<rootDir>/src/utils/testSetup.ts'
],
// Module paths
moduleNameMapper: {
// Path aliases from tsconfig
'^@/(.*)$': '<rootDir>/src/$1',
'^@/components/(.*)$': '<rootDir>/src/components/$1',
'^@/lib/(.*)$': '<rootDir>/src/lib/$1',
'^@/hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@/core/(.*)$': '<rootDir>/src/core/$1',
'^@/types/(.*)$': '<rootDir>/src/types/$1',
'^@/contexts/(.*)$': '<rootDir>/src/contexts/$1',
'^@/animations/(.*)$': '<rootDir>/src/animations/$1',
'^@/primitives/(.*)$': '<rootDir>/src/primitives/$1',
'^@/theme/(.*)$': '<rootDir>/src/theme/$1',
'^@/utils/(.*)$': '<rootDir>/src/utils/$1',
// Handle CSS imports
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
// Handle image imports
'\\.(jpg|jpeg|png|gif|svg|webp)$': '<rootDir>/__mocks__/fileMock.js',
},
// Transform files with ts-jest
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
tsconfig: '<rootDir>/tsconfig.tests.json',
}],
},
// Test match patterns
testMatch: [
'**/__tests__/**/*.{ts,tsx}',
'**/*.{spec,test}.{ts,tsx}'
],
// Liquid Glass upgrade tests live in tests/liquid-glass and use the same jsdom stack.
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/dist/',
'/docs/',
'/examples/',
'/test-results/',
'/playwright-report/',
'<rootDir>/tests/e2e/',
'tests/visual', // Separate visual regression suites
],
// Coverage configuration
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/*.stories.tsx',
'!src/utils/testingUtils.tsx',
'!src/**/*.test.{ts,tsx}',
'!src/**/__tests__/**',
'!src/types/**',
'!src/index.ts',
],
coverageThreshold: {
global: {
// Current whole-library coverage baseline. Raising this back toward 80%
// requires a dedicated coverage expansion pass across experimental systems,
// workers, AI services, and advanced component families.
branches: 28,
functions: 20,
lines: 33,
statements: 32
}
},
coverageReporters: ['text', 'lcov', 'html', 'json-summary'],
coverageDirectory: '<rootDir>/coverage',
// Module file extensions
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
// Verbose output
verbose: true,
// Max workers for parallel execution
maxWorkers: '50%',
// Heavy axe and canvas-adjacent component tests can exceed 10s under coverage.
testTimeout: 20000,
};