How to integration test hooks that depend on session? #3193
Unanswered
JohannesKlauss
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get a grasp on how to test component that depend on a user or that call resolvers depending on a server.
For simplicity reasons I just created a test database that is used inside the test environment.
This is a test file where I am trying to get a call to
useCurrentUser
to work:I don't quite understand where I should pass the ctx to to have the render method working correctly.
When the tests call the
getCurrentUser
resolver it of course fails withcannot find property userId of undefined
, because the session object is undefined.Beta Was this translation helpful? Give feedback.
All reactions