Cypress e2e testing 404 scenario
Unanswered
Nashville Warbler posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Nashville WarblerOP
How is everyone handling testing a notFound scenario with Cypress? My test was failing due to the NEXT_NOT_FOUND exception that Next throws. I ended up using a `cypress.on('uncaught:exception', (e, runnable) => { return false}).... but I feel like there must be a better way. I don't want to ingore ALL uncaught exceptions.
3 Replies
![Avatar](https://cdn.discordapp.com/avatars/657067112434499595/c78dd8e985ede1ad50c31ac682dd91a1.webp?size=256)
risky
that error is how redirect works with nextjs, so i think you will have to test that it is that error for success on test
[Invoking theredirect()
function throws aNEXT_REDIRECT
error and terminates rendering of the route segment in which it was thrown.](https://nextjs.org/docs/app/api-reference/functions/redirect)
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Nashville WarblerOP
ok thank you