diff options
Diffstat (limited to 'test/parallel/test-http-head-request.js')
-rw-r--r-- | test/parallel/test-http-head-request.js | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/test/parallel/test-http-head-request.js b/test/parallel/test-http-head-request.js index 68aaace7c3..e8626b1881 100644 --- a/test/parallel/test-http-head-request.js +++ b/test/parallel/test-http-head-request.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); -var assert = require('assert'); +const common = require('../common'); var http = require('http'); var body = 'hello world\n'; @@ -13,27 +12,20 @@ function test(headers) { server.close(); }); - var gotEnd = false; - - server.listen(0, function() { + server.listen(0, common.mustCall(function() { var request = http.request({ port: this.address().port, method: 'HEAD', path: '/' - }, function(response) { + }, common.mustCall(function(response) { console.error('response start'); - response.on('end', function() { + response.on('end', common.mustCall(function() { console.error('response end'); - gotEnd = true; - }); + })); response.resume(); - }); + })); request.end(); - }); - - process.on('exit', function() { - assert.ok(gotEnd); - }); + })); } test({ |