more db unit tests - best o luck !
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m41s

This commit is contained in:
2025-12-06 21:48:27 -08:00
parent 35d3f9d2e7
commit 6f74de3f88
10 changed files with 326 additions and 272 deletions

View File

@@ -106,6 +106,16 @@ describe('Admin DB Service', () => {
pendingCorrectionCount: 2,
});
});
it('should throw an error if one of the parallel queries fails', async () => {
// Mock one query to succeed and another to fail
mockPoolInstance.query
.mockResolvedValueOnce({ rows: [{ count: '10' }] })
.mockRejectedValueOnce(new Error('DB Read Error'));
// The Promise.all should reject, and the function should re-throw the error
await expect(getApplicationStats()).rejects.toThrow('DB Read Error');
});
});
describe('getDailyStatsForLast30Days', () => {