-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add missing unit tests for #2108 #2227
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
Conversation
subsequent token middleware tries to read `token.id` when `enableDoublecheck: true`. That caused a "Cannot read property `id` of `null`" error when the first middleware didn't actually find a valid accessToken.
|
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
|
@slnode ok to test |
| .expect(200) | ||
| .end(function(err, res) { | ||
| if (err) return done(err); | ||
| expect(res.body).to.eql({ |
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.
Is it necessary to check all token properties here? I am worried that if we add a new Token property in the future, we will have to fix way too many tests that don't really depend on specific Token properties.
It think it is enough to check that res.body.id is the same as token.id, isn't it?
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.
in my last unit test, I did exactly that - and you commented that only checking on id wouldn't be enough.
Let me know which one you prefer
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.
I see, sorry for me not being consistent! Let's keep what you have now.
|
@benkroeger thank you for the pull request. The patch looks good in general, I pointed out two details to improve in the comments above. |
|
Landed via 103935c, thank you for the contribution! |
Subsequent token middleware tries to read `token.id` when `enableDoublecheck: true`. That caused a "Cannot read property `id` of `null`" error when the first middleware didn't actually find a valid accessToken. [back-port of #2227]
subsequent token middleware tries to read
token.idwhenenableDoublecheck: true. That caused a "Cannot read propertyidofnull" error when the first middleware didn't actually find a valid accessToken.@bajtos
fixes #2226