Coding task · NestJS course · Module 6: Error Handling and Monitoring

Test Exception Filter

Create a test that verifies the Exception Filter correctly formats a 404 error

Task

Complete the test it('should catch NotFoundException') that creates a mock response and request, calls filter.catch(new NotFoundException(), mockHost), and verifies that response.status was called with 404