Skip to content

How to mock nuxt-auth-sanctum #185

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

You must be logged in to vote

Hey @martijnhalekor, this is a really good question! Thanks for bringing it up here.

I see here several options:

  1. Keep some test Laravel API up and running for tests (this is what I usually do while developing new features for the module)
  2. Write server functionality for your fixture application and use its URL in your nuxt config. Technically, all requests will be handled by your app, not the actual Laravel instance. But it requires a server to be supported.
  3. You can disable sanctum.client.initialRequest for tests, so the module won't bother you if you are not interested in authentication testing

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