refactor(test): consolidate local http server creation #1950
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the same pattern used to create HTTPS local servers, added a utility
that creates and listens for a HTTP server and ensures it gets closed after the test ends.
There were some tests that weren't properly closing the server if the
test failed, but mostly this refactor reduces boilerplate from tests.
Not all tests that call
http.createServer
were updated. The onesnot migrated to Mocha DSL or Chai were left alone since they're due
for refactors anyway.