diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index 551cea19829d93..6878b16085f0c3 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -47,6 +47,7 @@ server.listen(0, function() { } req.on('error', common.mustCall(function(er) { + assert.strictEqual(req.res, null); switch (er.code) { // This is the expected case case 'ECONNRESET': @@ -73,10 +74,7 @@ server.listen(0, function() { server.close(); })); - req.on('response', function(res) { - res.on('data', common.mustNotCall('Should not receive response data')); - res.on('end', common.mustNotCall('Should not receive response end')); - }); + req.on('response', common.mustNotCall()); write(); });