Files
token-circles/backend/jest.unit.config.js
T
KomediruzeckiandGitHub cc0352426e feat: bill calendar, error handling standardization, Zod validation, unit tests
Two major improvements:

### Error Handling Standardization
- lib/errors.js: AppError class + asyncHandler wrapper
- Centralized error middleware, ~186 try/catch blocks removed from 23 routes
- Zod validation middleware for transactions
- New repos: settingsRepo, usersRepo
- 70 unit tests for baseRepo + loanCalculator

### Bill Calendar View
- BillCalendar.tsx with monthly grid, popover, mark-paid
- GET /api/bills/calendar endpoint
- 7 E2E tests

### Testing: 458 E2E + 70 unit tests passing
2026-06-24 01:35:48 +02:00

31 lines
810 B
JavaScript

module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>'],
testMatch: ['**/test/unit/**/*.spec.js', '**/test/unit/**/*.test.js'],
collectCoverageFrom: [
'repositories/**/*.js',
'services/**/*.js',
'utils.js',
'routes/**/*.js',
'!node_modules/**',
'!index.js',
],
coverageDirectory: '<rootDir>/coverage',
coverageReporters: ['text', 'text-summary', 'lcov', 'html'],
// Ratchet up as coverage increases. Target: 60%+ across the board.
coverageThreshold: {
global: {
branches: 5,
functions: 5,
lines: 5,
statements: 5,
},
},
modulePaths: ['<rootDir>'],
moduleDirectories: ['node_modules', '<rootDir>'],
verbose: true,
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/../test/__mocks__/styleMock.js',
},
};