-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How would you test cookies? #7
Comments
Hello @EnriqueCepeda, as per my understanding of the question, I think using our request object does give us access to the created cookie.
Although this approach would not be greatly suggested, rather have a server side module or function where you can call in the cookie and check up on things in any way you would like to, and you might call that function in any of the loader you would prefer to. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! In my company, we're using Remix, and we're making more or less the same approach of auth with Cookies, but haven't been able to test it correctly. We're trying to test that a loader has a cookie that an action has previously set with:
redirect("/", {headers: {"Set-Cookie": "cookie=foo"}})
. The problem is that the loader doesn't receive any cookie, and it has been impossible to test it using remixStub.Testing auth is very important for us, but ideally, we don't want to start using an e2e tool such as playwright because Vitest (+ happy-dom) is way faster, is there anything you think we might be missing or do you have any comment?
Furthermore, it would be awesome if you show us how would you to test these kinds of examples!
The text was updated successfully, but these errors were encountered: