feat: log unhandled errors and pretty dev output (WealthLedger/backend#120)
This commit is contained in:
+11
-2
@@ -554,8 +554,17 @@ describe('Authentication (e2e)', () => {
|
||||
expect(body).toEqual({ status: 500, code: 'INTERNAL_SERVER_ERROR' }),
|
||||
);
|
||||
|
||||
const completed = logs.filter((entry) => entry.requestId === response.headers['x-request-id']);
|
||||
expect(completed).toEqual([
|
||||
const related = logs.filter((entry) => entry.requestId === response.headers['x-request-id']);
|
||||
expect(related).toEqual([
|
||||
expect.objectContaining({
|
||||
requestId: response.headers['x-request-id'],
|
||||
clientRequestId,
|
||||
code: 'INTERNAL_SERVER_ERROR',
|
||||
level: 50,
|
||||
message: 'http.request.unhandled',
|
||||
errorName: 'Error',
|
||||
errorStack: expect.stringContaining(' at ') as unknown,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
requestId: response.headers['x-request-id'],
|
||||
clientRequestId,
|
||||
|
||||
Reference in New Issue
Block a user