Skip to content

Conversation

@JamesDoingStuff
Copy link
Contributor

Adds a handler for a protocol upgrade request that was seen to be uncaught when running TemplateView.test.tsx (specifically, the test that 'submits' a workflow).
Also adds another GraphQL handler that will match and block any request that hasn't already matched one of the previous predicates.

),

// Catch all remaining unintercepted queries
api.operation(() => {}),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does handler ordering matter for Mock Service Worker? eg does the "catch all" handler have to go last?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had thought so - MSW iterates through the handlers in order, using the first one that handles the request - but I've just seen that returning nothing doesn't actually count as handling, so I suppose it doesn't matter. I think this will still suffice for intercepting though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants