Hi all
Could someone please explain me, what is the use case of
https://hexdocs.pm/phoenix/Phoenix.ConnTest.html#bypass_through/1
I read the doc but could not configure out for what does it for.
Thanks
Hi all
Could someone please explain me, what is the use case of
https://hexdocs.pm/phoenix/Phoenix.ConnTest.html#bypass_through/1
I read the doc but could not configure out for what does it for.
Thanks
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.