test: simplify test-tls-set-secure-context
- Instead of recursively scheduling
makeRemainingRequests
and ignoring its outcome, safely loop within the async function. - Avoid unncessary async lambda functions passed to
assert.rejects
. - Use
events.once()
to simplify control flow inmakeRequest
, instead of manually constructing aPromise
.
(Consider hiding whitespace changes for review.)