Exercice de code · Cours NestJS · Module 6: Gestion des erreurs et monitoring

Tester un Exception Filter

Crée un test qui vérifie que l'Exception Filter formate correctement une erreur 404

Exercice

Complète le test it('should catch NotFoundException') qui crée un mock de response et request, appelle filter.catch(new NotFoundException(), mockHost) et vérifie que response.status a été appelé avec 404