Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
http2: correct emit error in onConnect, full tests #15080
Minor correction in
The test cases are a bit complicated as I felt like it was important to actually test all available errors, in case someone ever goes in and expands the switch statement to handle any other specific errors (or removes one of the currently handled ones). This way it avoids any accidental regressions where errors start emitting somewhere different than expected.
I also have a version of this for
(I tried to find if there was any convention for mocking functions but it seemed like this is how it was done elsewhere.)
Let me know if there's anything I can adjust. Thanks!
Affected core subsystem(s)
This change is ok.
Can you remove
I think it would be easier to debug in this way.
It looks like right now only the event emits (in fact, looks like only the errors) are being run on nextTick, whereas a lot of the other stuff might be sync? So I guess I just wanted to confirm that we're ok with moving this up to where