mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: ensure assertions are reached on more tests
PR-URL: https://github.com/nodejs/node/pull/60759 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
57 files changed
+246
-286
No files matched your search
@@ -63,7 +63,7 @@ const server = https.createServer(options, common.mustCall(function(req, res) {
|
||||
console.log('sent response');
|
||||
}));
|
||||
|
||||
server.listen(0, function() {
|
||||
server.listen(0, common.mustCall(function() {
|
||||
const args = ['s_client',
|
||||
'-quiet',
|
||||
'-connect', `127.0.0.1:${this.address().port}`,
|
||||
@@ -72,21 +72,20 @@ server.listen(0, function() {
|
||||
|
||||
const client = spawn(opensslCli, args);
|
||||
|
||||
client.stdout.on('data', function(data) {
|
||||
client.stdout.on('data', common.mustCallAtLeast((data) => {
|
||||
console.log('response received');
|
||||
const message = data.toString();
|
||||
const contents = message.split('\r\n\r\n').pop();
|
||||
assert.strictEqual(body, contents);
|
||||
server.close((e) => {
|
||||
assert.ifError(e);
|
||||
server.close(common.mustSucceed(() => {
|
||||
console.log('server closed');
|
||||
});
|
||||
}));
|
||||
console.log('server.close() called');
|
||||
});
|
||||
}));
|
||||
|
||||
client.stdin.write('GET /\r\n\r\n');
|
||||
|
||||
client.on('error', function(error) {
|
||||
throw error;
|
||||
});
|
||||
});
|
||||
}));
|
||||
Reference in new issue
Block a user