-
Notifications
You must be signed in to change notification settings - Fork 663
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
Fix #1409 installerOptions.failure() options can be undefined #1410
Conversation
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.
comments for reviewers
@@ -566,7 +569,6 @@ describe('OAuth', async () => { | |||
}, | |||
failure: async (error, installOptions, req, res) => { | |||
assert.fail(error.message); | |||
res.send('failure'); |
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.
This is just unnecessary
@@ -588,7 +590,6 @@ describe('OAuth', async () => { | |||
}, | |||
failure: async (error, installOptions, req, res) => { | |||
assert.fail(error.message); | |||
res.send('failure'); |
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.
same as above
// Call the failure callback | ||
if (options !== undefined && options.failure !== undefined) { | ||
this.logger.debug('calling passed in options.failure'); | ||
options.failure(error, installOptions!, req, res); |
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.
Removing !
here now compiles!
@@ -447,6 +447,7 @@ describe('OAuth', async () => { | |||
assert.fail('should have failed'); | |||
}, | |||
failure: async (error, installOptions, req, res) => { | |||
assert.isDefined(installOptions); |
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.
This fails before the changes in this PR
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.
May I also suggest updating the test title (here and for the other tests) to reflect this new requirement? Perhaps changing "should call the failure callback..." to "should call the failure callback with installation options..."?
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.
Great suggestion -- will update the test label before merging this
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! Left a tiny comment.
@@ -447,6 +447,7 @@ describe('OAuth', async () => { | |||
assert.fail('should have failed'); | |||
}, | |||
failure: async (error, installOptions, req, res) => { | |||
assert.isDefined(installOptions); |
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.
May I also suggest updating the test title (here and for the other tests) to reflect this new requirement? Perhaps changing "should call the failure callback..." to "should call the failure callback with installation options..."?
Summary
This pull request resolves #1409
Requirements (place an
x
in each[ ]
)