Skip to content

How do I test a secured API endpoint? #1527

Discussion options

You must be logged in to vote

Maybe you could mock getSession itself, or even better, mock the request to /api/auth/session with

https://mswjs.io/

https://kentcdodds.com/blog/stop-mocking-fetch

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@benaissazaki
Comment options

Answer selected by balazsorban44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants