From 2f1dea6f9a903f22c485eea08967916225608977 Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Sat, 24 Oct 2026 14:45:46 +0300 Subject: [PATCH] test(logging): match correlation on unhandled requests --- test/app.e2e-spec.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/app.e2e-spec.ts b/test/app.e2e-spec.ts index 1d5aa8e..b751f6f 100644 --- a/test/app.e2e-spec.ts +++ b/test/app.e2e-spec.ts @@ -539,7 +539,14 @@ describe('Authentication (e2e)', () => { 'X-Request-ID', ); expect(logs.filter((entry) => entry.requestId === response.headers['x-request-id'])).toEqual([ - expect.objectContaining({ level: 40, message: 'http.request.completed', status: 401, code: 'UNAUTHORIZED' }), + expect.objectContaining({ + level: 40, + message: 'http.request.completed', + method: 'GET', + route: '/api/v1/auth/me', + status: 401, + code: 'UNAUTHORIZED', + }), ]); }); @@ -561,7 +568,9 @@ describe('Authentication (e2e)', () => { expect(body).toEqual({ status: 500, code: 'INTERNAL_SERVER_ERROR' }), ); - const related = logs.filter((entry) => entry.requestId === response.headers['x-request-id']); + const related = logs.filter((entry) => + entry.requestId === response.headers['x-request-id'] || entry.clientRequestId === clientRequestId, + ); expect(related).toEqual([ expect.objectContaining({ requestId: response.headers['x-request-id'],