E2E Tests with BetterAuth

Hello, I am making E2E tests and am having difficulties authenticating my API requests. I am making requests with fetch (should I use something else?) and naively thought it would be enough to use use credentials: 'include' to authenticate with cookies. I suspect this doesn't work because BetterAuth sets cookie samsite attribute to lax, thus ignoring credentials: 'include'. So in short my question is, how am I supposed to do E2E testing with BetterAuth?
Solution:
I solved it by changing from using fetch to using supertest, which allows automatically setting the cookie via the Supertest Agent.
Jump to solution
1 Reply
Solution
AuthenticMailbox
I solved it by changing from using fetch to using supertest, which allows automatically setting the cookie via the Supertest Agent.

Did you find this page helpful?