Skip to content

How to conditionally set the response for an intercepted server-side request per test? #2197

Closed Answered by kettanaito
Addison-Dalton asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, @Addison-Dalton. That's a great question. What you are describing is currently not supported in any test runner or framework. The idea of affecting the network of a different process is rather new.

We have a work-in-progress API to allow you to do precisely what you described called setupRemoteServer(). See #1617. It establishes a WebSocket bridge between any two given processes, allowing one process to affect the network of the other.

I've designed that API exactly for your use case: to allow per-test server-side network changes during e2e testing.

That feature still needs development and you are unlikely to use it in its current state. If this is something you depend on at work, ple…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Addison-Dalton
Comment options

Answer selected by Addison-Dalton
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