Skip to content

Block all unmocked requests #874

Answered by kettanaito
amd-9 asked this question in Q&A
Aug 20, 2021 · 1 comments · 8 replies
Discussion options

You must be logged in to vote

Hey, @amd-9.

Yes, you can set the onUnhandledRequest option to "error". This will result in an error whenever an unhandled request happens, failing your test:

server.listen({ onUnhandledRequest: 'error' })

See the docs.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@kettanaito
Comment options

@amd-9
Comment options

@amd-9
Comment options

@kettanaito
Comment options

@amd-9
Comment options

Answer selected by amd-9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants