How to mock nuxt-auth-sanctum #185
-
Hello and first of all thanks for this wonderful Nuxt module! <3 I'm currently setting up an SPA in Nuxt and need to start adding unit tests to my components. After adding my first smoke test, I noticed some logs by the nuxt-auth-sanctum module: Which got me wondering, how do I go about mocking this auth module? Any tips or examples are greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @martijnhalekor, this is a really good question! Thanks for bringing it up here. I see here several options:
|
Beta Was this translation helpful? Give feedback.
Hey @martijnhalekor, this is a really good question! Thanks for bringing it up here.
I see here several options:
sanctum.client.initialRequest
for tests, so the module won't bother you if you are not interested in authentication testing