Integration testing with test client and HTTP only cookies
Hello,
I have an API with HTTP only cookies built with Hono (Behind Next.js https://hono.dev/docs/getting-started/vercel). I tried to do some integration testing with Hono test client and vitest. I ran into a big issue that is my HTTP only cookies aren't send back to the server. It's normal since HTTP only behavior is handle by the browser and not Node or bun. So I was wondering what tooling or how could i do this integration testing. I want to run it in my CI CD.
Any idea or recommendation is welcome ^^
And with a console log in my middleware i seed that my cookie is not being send
4 Replies
I can provide the repo with the project if needed, I just need to migrate it to testcontainers for the database
You can pass the cookies in the header
yes but since it's and http cookies i recieve it from the login but has no way to access it with javascript
Oh way maybe I said something stupid xd
I think if you are getting it from the server you can check the response for the
Set-Cookie
header to get the cookie