Use case of bypass_through(conn)

Hi all

Could someone please explain me, what is the use case of

I read the doc but could not configure out for what does it for.


1 Like

This is used in testing when you need a connection that has run through your endpoint, router, and pipelines/plugs. It gives you a connection that is all set up with the data transformations needed in your tests.

An example would be if you are testing a function that needs to fetch the session from the connection. The connection would need to be prepared (using bypass_through) for that.


It’s also worth pointing out that this is well documented in the link @kostonstyle posted above.