From 771af8f2120446fffee91308bbaa30edb3a6a4bb Mon Sep 17 00:00:00 2001 From: Omer Mujtaba Date: Fri, 20 Sep 2024 00:52:30 +0300 Subject: [PATCH] test: fix unhandled-error.filter tests --- .../filters/unhandled-error/unhandled-error.filter.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/filters/unhandled-error/unhandled-error.filter.spec.ts b/src/common/filters/unhandled-error/unhandled-error.filter.spec.ts index 759f798..4d0c529 100644 --- a/src/common/filters/unhandled-error/unhandled-error.filter.spec.ts +++ b/src/common/filters/unhandled-error/unhandled-error.filter.spec.ts @@ -35,14 +35,17 @@ describe('UnhandledErrorFilter', () => { filter.catch(exception, mockArgumentsHost); - expect(logger.error).toHaveBeenCalledWith('Unhandled error', { + expect(logger.error).toHaveBeenCalledWith('Test error', { stack: exception.stack, + error: exception, }); expect(mockResponse.status).toHaveBeenCalledWith( HttpStatus.INTERNAL_SERVER_ERROR, ); expect(mockResponse.json).toHaveBeenCalledWith({ message: 'Something went wrong!', + error: 'Unknown error', + statusCode: 500, }); }); });