diff options
Diffstat (limited to 'test/parallel/test-http-buffer-sanity.js')
-rw-r--r-- | test/parallel/test-http-buffer-sanity.js | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/test/parallel/test-http-buffer-sanity.js b/test/parallel/test-http-buffer-sanity.js index 2fef4d0550..542d4ad5af 100644 --- a/test/parallel/test-http-buffer-sanity.js +++ b/test/parallel/test-http-buffer-sanity.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); var assert = require('assert'); var http = require('http'); @@ -42,9 +42,7 @@ var web = http.Server(function(req, res) { }); }); -var gotThanks = false; - -web.listen(0, function() { +web.listen(0, common.mustCall(function() { console.log('Making request'); var req = http.request({ @@ -52,19 +50,17 @@ web.listen(0, function() { method: 'GET', path: '/', headers: { 'content-length': buffer.length } - }, function(res) { + }, common.mustCall(function(res) { console.log('Got response'); res.setEncoding('utf8'); - res.on('data', function(string) { + res.on('data', common.mustCall(function(string) { assert.equal('thanks', string); - gotThanks = true; - }); - }); + })); + })); req.end(buffer); -}); +})); process.on('exit', function() { assert.equal(bufferSize, measuredSize); - assert.ok(gotThanks); }); |