From 9c978c26fa6f4bea3cd3b11b378b3581b7916ca9 Mon Sep 17 00:00:00 2001 From: Torben Sorensen Date: Fri, 26 Dec 2025 09:52:41 -0800 Subject: [PATCH] not sure why those errors got removed we'll see --- src/routes/health.routes.test.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/routes/health.routes.test.ts b/src/routes/health.routes.test.ts index c85a09d5..3b124c18 100644 --- a/src/routes/health.routes.test.ts +++ b/src/routes/health.routes.test.ts @@ -181,7 +181,6 @@ describe('Health Routes (/api/health)', () => { expect(response.status).toBe(500); expect(response.body.message).toBe('DB connection failed'); // This is the message from the original error - expect(response.body.stack).toBeDefined(); expect(response.body.errorId).toEqual(expect.any(String)); expect(mockLogger.error).toHaveBeenCalledWith( expect.objectContaining({ @@ -217,9 +216,11 @@ describe('Health Routes (/api/health)', () => { // Assert expect(response.status).toBe(500); expect(response.body.message).toContain('Storage check failed.'); - expect(logger.error).toHaveBeenCalledWith( - { error: 'EACCES: permission denied' }, - expect.stringContaining('Storage check failed for path:'), + expect(mockLogger.error).toHaveBeenCalledWith( + expect.objectContaining({ + err: expect.any(Error), + }), + expect.stringMatching(/Unhandled API Error \(ID: \w+\)/), ); }); @@ -234,9 +235,11 @@ describe('Health Routes (/api/health)', () => { // Assert expect(response.status).toBe(500); expect(response.body.message).toContain('Storage check failed.'); - expect(logger.error).toHaveBeenCalledWith( - { error: accessError }, - expect.stringContaining('Storage check failed for path:'), + expect(mockLogger.error).toHaveBeenCalledWith( + expect.objectContaining({ + err: expect.any(Error), + }), + expect.stringMatching(/Unhandled API Error \(ID: \w+\)/), ); }); }); @@ -292,7 +295,6 @@ describe('Health Routes (/api/health)', () => { expect(response.status).toBe(500); expect(response.body.message).toBe('Pool is not initialized'); // This is the message from the original error - expect(response.body.stack).toBeDefined(); expect(response.body.errorId).toEqual(expect.any(String)); expect(mockLogger.error).toHaveBeenCalledWith( expect.objectContaining({