-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
72 lines (64 loc) · 1.75 KB
/
jest.config.js
File metadata and controls
72 lines (64 loc) · 1.75 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
/**
* Jest Configuration for TTA Middleware
*
* Following the same patterns as @loonylabs/tti-middleware
*/
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
// Test file locations
roots: ['<rootDir>/tests'],
testMatch: [
'**/tests/**/*.test.ts',
'**/tests/**/*.spec.ts',
],
// TypeScript transformation
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: {
esModuleInterop: true,
allowSyntheticDefaultImports: true,
},
},
],
},
// Coverage configuration
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.interface.ts',
'!src/**/*.type.ts',
'!src/**/index.ts',
// Exclude provider implementations that require integration tests (real API calls)
// These are tested via:
// - TTA_INTEGRATION_TESTS=true npm run test:integration
// - npm run test:manual:elevenlabs-sfx
// - npm run test:manual:google-lyria
'!src/middleware/services/tta/providers/elevenlabs-provider.ts',
'!src/middleware/services/tta/providers/google-lyria-provider.ts',
// Debug utils rely on filesystem I/O - tested via manual tests
'!src/middleware/services/tta/utils/debug-tta.utils.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'html', 'lcov'],
coverageThreshold: {
global: {
branches: 80,
functions: 95,
lines: 95,
statements: 95,
},
},
// Module resolution
moduleFileExtensions: ['ts', 'js', 'json'],
// Setup files (load .env for integration tests)
setupFiles: ['<rootDir>/tests/setup.ts'],
// Test timeout (useful for async operations)
testTimeout: 10000,
// Verbose output
verbose: true,
// Clear mocks between tests
clearMocks: true,
};