Closed LodewijkSioen closed 4 years ago
Nevermind, I just realised that this is an issue with my code 😄 Some client can also just listen to the statuscode and not bother with the body. They'll get a 200 but the transaction can still fail. I'll have to put my transactions elsewhere.
I'm using an xUnit collection fixture to setup Alba. In my test I have the following (pseudo) code:
My assertion fails at this point. If I check what's in the database after the test has run, I see the updated values. I can make the test run if I read the body of the request before my assertion.
My guess is that the body of my request is only streamed if I actually read it. That means that the transaction (from middleware) around my api-call is still open when I do my assertions.
Is there an easy way to tell Alba to close the request when I'm not interested in the body?