lundi 13 janvier 2020

How to write a test for Plug error handling

I'm trying to use Plug.Test to test error handling implemented with Plug.ErrorHandler -- with assert conn.status == 406 and alike.

I have the defp handle_errors (containing a single send_resp statement) and it seems to be called, however, my tests fail with the same exception still (as if handle_errors has no effect).

A reference to a sample advanced Plug (not Phoenix) app will also be appreciated.

Aucun commentaire:

Enregistrer un commentaire