Skip to content

Mocking useSanctumClient #364

Answered by manchenkoff
rkrater asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @rkrater! Behind the scenes, useSanctumClient just creates an instance of ofetch client via ofetch.create() method, so you can check how this object can be mocked.

Another option is to point sanctum module to your Nuxt app instead of actual API and mock the response instead. You can check an example in the tests used for nuxt-auth-sanctum itself - here.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by manchenkoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants