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

Adds test for #6968 #7000

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

erik-singleton
Copy link

Summary

#6968 fixed a regression where a class of errors from request were unhandled (leaving ssl cert errors to be swallowed).

This PR just adds a test to hopefully catch future regressions.

While adding this test, I noticed some tests from #6413 were leaking and addressed that as well.

@arcanis and @yan12125 do these changes look helpful?

I did not update CHANGELOG as actual code was unchanged.

Test plan

Successfully ran yarn test

image

headers: {Connection: 'close'},
},
resolve: body => {},
reject: err => {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this callback be spied on? At the moment Jest doesn't check whether it's actually called 🤔

Copy link
Author

Choose a reason for hiding this comment

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

I was actually just following existing convention, but it looks like the tests are invoking the callback manually, which runs the "async" resolution. The await in front of config.requestManager.execute is misleading because RequestManager#execute is a void method.

The tests technically test the correct behavior, but could probably be a bit more straightforward.

@yan12125
Copy link
Contributor

@yan12125 do these changes look helpful?

I have little knowledge on how tests work in yarn. GTM as long as tests pass :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants