more db unit tests - best o luck !
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m41s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m41s
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user