-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
64 lines (54 loc) · 1.55 KB
/
Copy pathjest.config.js
File metadata and controls
64 lines (54 loc) · 1.55 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
/**
* Jest Configuration for LANStreamer
*
* Test Organization:
* - tests/unit/ : Isolated unit tests for individual functions/modules
* - tests/integration/: Tests that verify multiple components working together
* - tests/e2e/ : End-to-end tests simulating real user workflows
*
* Run tests:
* npm test # Run all tests once
* npm test -- --watch # Watch mode for development
* npm test -- --coverage # Generate coverage report
* npm test -- unit # Run only unit tests
* npm test -- integration # Run only integration tests
*/
export default {
// Test environment
testEnvironment: 'node',
// Test file patterns
testMatch: [
'**/tests/**/*.test.js'
],
// Coverage configuration
collectCoverageFrom: [
'src/**/*.js',
'!src/server.js', // Entry point, low value
'!src/**/*.test.js', // Exclude test files
'!src/config/index.js' // Config files are environment-specific
],
coverageThreshold: {
global: {
statements: 30,
branches: 25,
functions: 30,
lines: 30
}
},
// Setup files
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
// Timeout for integration tests (may need more time for Icecast/FFmpeg)
testTimeout: 30000,
// Clear mocks between tests
clearMocks: true,
restoreMocks: true,
// Verbose output for better debugging
verbose: true,
// Module paths
moduleDirectories: ['node_modules', 'src'],
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/dist/'
]
};