Testing Middleware Behavior in HttpApi Endpoints
How to test middleware behavior in HttpApi endpoints?
Hi everyone!
I'm working with Effect's HttpApi and trying to test middleware behavior, specifically JWT bearer authentication middleware. I have a protected endpoint that uses
1. Missing authorization header (should fail with 403)
2. Invalid authorization header format (should fail with 401)
3. Valid bearer token (should succeed)
Full code https://effect.website/play/#0ae1977b6282
Here's my current working solution using
[continued]
Hi everyone!
I'm working with Effect's HttpApi and trying to test middleware behavior, specifically JWT bearer authentication middleware. I have a protected endpoint that uses
JwtSpec middleware, and I want to test different scenarios:1. Missing authorization header (should fail with 403)
2. Invalid authorization header format (should fail with 401)
3. Valid bearer token (should succeed)
Full code https://effect.website/play/#0ae1977b6282
Here's my current working solution using
HttpApiClient.makeWith:[continued]
