-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Improve test coverage for CallClient error cases. #22599
Improve test coverage for CallClient error cases. #22599
Conversation
}); | ||
|
||
searchRequests = [ searchRequestFail ]; | ||
const callingClient = callClient(searchRequests); | ||
it(`calls the errorHandler provided to the searchRequest`, () => { |
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 the assertion I missed originally.
await callClient(searchRequests); | ||
} catch(e) { | ||
|
||
return callClient(searchRequests).then(() => { |
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 fixes a bug in the original assertion. The original assertion was never made because callClient
doesn't re-throw errors.
💚 Build Succeeded |
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
Follow-on to #22558. I realized I missed an important assertion for error cases, and found a couple spots where the assertions were incorrect. I also cleaned up some formatting inconsistencies (sorry for the noise). I'm going to backport this to 6.4 to keep these changes grouped with the changes from the original PR.