How do I test a secured API endpoint? #1527
Answered
by
balazsorban44
benaissazaki
asked this question in
Help
-
I have this simple API and I want to test it:
I heard of node-mocks-http to mock requests and responses, but how can I mock a Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
balazsorban44
Mar 16, 2021
Replies: 1 comment 1 reply
-
Maybe you could mock getSession itself, or even better, mock the request to /api/auth/session with |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
balazsorban44
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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