Skip to content

Commit

Permalink
test: fix unhandled-error.filter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
omermujtaba18 committed Sep 19, 2024
1 parent 44a890d commit 771af8f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
});

0 comments on commit 771af8f

Please sign in to comment.