-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better cookie error handling #153
Conversation
…show the same results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a few test-related nits and suggestions.
'You must provide a valid cookie password that is at least 32 characters in the environment variables.', | ||
); | ||
|
||
jest.replaceProperty(envVariables, 'WORKOS_COOKIE_PASSWORD', originalWorkosCookiePassword); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set restoreMocks
to true in the Jest config then properties like this will automatically be restored between tests without a need to keep track of original values like this. I think it's a good default behavior to go with.
Fixes #112
Throws if the cookie password is missing or if it's too short.
Also adds a test for the
onSuccess
handler, which was merged prior to when we had tests for this repo.