I have a application using the Vue framework for the client, and laravel for the server.
My authentication is done via laravel sanctum, which is a cookie based authentication system. My current setup is running vitest in vs code. My client uses axios for api calls.
Unfortunately, I am unable to unit test the majority of my code due to authentication issues. (which is what I am hoping to resolve here)
I tried wrapping the applications login process in vitest, which I expected to behave the same as the browser.
My current attempt runs as:
Server side testing runs fine; however, the goal here is to test client side code. Since the login form works on the browser, I'd expect it to work in Vitest as well.
It's as if either vitest or vs code doesn't maintain the state for me to use consistently.
Thus, I searched and couldn't find any topics on it.
Since I'm mostly looking for process, I haven't posted my code, but can post it later if that'll be an easier path forward.
Working solution was:
That being said, now I use passport, and have a client for testing