Enhance Context Manager test suite and improve test coverage

- Refactored and simplified Context Manager test cases
- Updated test scenarios for resource management, relationships, and event subscriptions
- Improved test readability and reduced test complexity
- Configured Jest to collect and report code coverage
- Added coverage thresholds and reporting options
This commit is contained in:
jango-blockchained
2025-01-30 20:07:00 +01:00
parent 96aaffd952
commit 90cf0ca315
4 changed files with 561 additions and 600 deletions

View File

@@ -26,14 +26,32 @@ module.exports = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testMatch: [
'**/__tests__/helpers.test.ts',
'**/__tests__/schemas/devices.test.ts'
'**/__tests__/schemas/devices.test.ts',
'**/__tests__/context/index.test.ts'
],
globals: {
'ts-jest': {
useESM: true,
},
},
collectCoverage: false,
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'clover', 'html'],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/types/**/*',
'!src/polyfills.ts'
],
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50
}
},
verbose: true,
testTimeout: 30000
};