-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.cjs
More file actions
76 lines (71 loc) · 1.77 KB
/
jest.config.cjs
File metadata and controls
76 lines (71 loc) · 1.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
/**
* Jest Configuration for Tindy Chrome Extension
*
* This configuration supports:
* - Unit tests for popup modules
* - Integration tests for content script
* - Chrome Extension API mocking
* - Code coverage reporting
*/
module.exports = {
// Use multiple projects for different test types
projects: [
{
displayName: 'unit',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/__tests__/unit/**/*.test.js'],
setupFilesAfterEnv: ['<rootDir>/__tests__/setup/unit-setup.js'],
collectCoverageFrom: [
'popup/**/*.js',
'!popup/index.js', // Entry point, tested via integration
'!**/node_modules/**',
],
transform: {
'^.+\\.js$': 'babel-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
},
{
displayName: 'integration',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/__tests__/integration/**/*.test.js'],
setupFilesAfterEnv: ['<rootDir>/__tests__/setup/integration-setup.js'],
collectCoverageFrom: [
'content.js',
'popup/**/*.js',
],
transform: {
'^.+\\.js$': 'babel-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
},
],
// Global settings
coverageDirectory: '<rootDir>/coverage',
coverageReporters: ['text', 'lcov', 'html', 'json-summary'],
coverageThreshold: {
global: {
branches: 70,
functions: 75,
lines: 80,
statements: 80,
},
},
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/__tests__/setup/',
'/__tests__/helpers/',
'/__tests__/mocks/',
],
// Verbose output
verbose: true,
// Clear mocks between tests
clearMocks: true,
resetMocks: true,
restoreMocks: true,
};