Skip to content
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

Merged
merged 1 commit into from
Aug 31, 2018

Conversation

cjcenizal
Copy link
Contributor

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.

});

searchRequests = [ searchRequestFail ];
const callingClient = callClient(searchRequests);
it(`calls the errorHandler provided to the searchRequest`, () => {
Copy link
Contributor Author

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(() => {
Copy link
Contributor Author

@cjcenizal cjcenizal Aug 31, 2018

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.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants