diff --git a/test/plugins/jsonBodyParser.test.js b/test/plugins/jsonBodyParser.test.js index 431b477f3..74ffbdf95 100644 --- a/test/plugins/jsonBodyParser.test.js +++ b/test/plugins/jsonBodyParser.test.js @@ -257,9 +257,12 @@ describe('JSON body parser', function() { '\r\n' + '{"foo":"bar"}'; - var client = net.connect({ host: '127.0.0.1', port: PORT }, function() { - client.write(request); - }); + var client = net.connect( + { host: '127.0.0.1', port: PORT }, + function() { + client.write(request); + } + ); client.once('data', function(data) { client.end(); }); @@ -290,9 +293,12 @@ describe('JSON body parser', function() { '\r\n' + '{"foo":"bar"}'; - var client = net.connect({ host: '127.0.0.1', port: PORT }, function() { - client.write(request); - }); + var client = net.connect( + { host: '127.0.0.1', port: PORT }, + function() { + client.write(request); + } + ); client.once('data', function(data) { client.end(); diff --git a/test/plugins/static.test.js b/test/plugins/static.test.js index b80bff32b..36c03dd98 100644 --- a/test/plugins/static.test.js +++ b/test/plugins/static.test.js @@ -321,11 +321,17 @@ describe('static resource plugin', function() { }); }); - socket.connect({ host: '127.0.0.1', port: PORT }, function() { - socket.write(RAW_REQUEST, 'utf-8', function(err2, data) { - assert.ifError(err2); - }); - }); + socket.connect( + { host: '127.0.0.1', port: PORT }, + function() { + socket.write(RAW_REQUEST, 'utf-8', function( + err2, + data + ) { + assert.ifError(err2); + }); + } + ); }); } ); @@ -363,12 +369,18 @@ describe('static resource plugin', function() { }); var socket = new net.Socket(); - socket.connect({ host: '127.0.0.1', port: PORT }, function() { - socket.write(RAW_REQUEST, 'utf-8', function(err2, data) { - assert.ifError(err2); - socket.end(); - }); - }); + socket.connect( + { host: '127.0.0.1', port: PORT }, + function() { + socket.write(RAW_REQUEST, 'utf-8', function( + err2, + data + ) { + assert.ifError(err2); + socket.end(); + }); + } + ); }); } ); diff --git a/test/server.test.js b/test/server.test.js index 4229e5bef..f9b7fd225 100644 --- a/test/server.test.js +++ b/test/server.test.js @@ -396,15 +396,13 @@ test('PATCH ok', function(t) { method: 'PATCH', agent: false }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 200); - res.on('end', function() { - t.end(); - }); - res.resume(); - }) - .end(); + http.request(opts, function(res) { + t.equal(res.statusCode, 200); + res.on('end', function() { + t.end(); + }); + res.resume(); + }).end(); }); test('HEAD ok', function(t) { @@ -423,17 +421,15 @@ test('HEAD ok', function(t) { method: 'HEAD', agent: false }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 200); - res.on('data', function(chunk) { - t.fail('Data was sent on HEAD'); - }); - res.on('end', function() { - t.end(); - }); - }) - .end(); + http.request(opts, function(res) { + t.equal(res.statusCode, 200); + res.on('data', function(chunk) { + t.fail('Data was sent on HEAD'); + }); + res.on('end', function() { + t.end(); + }); + }).end(); }); test('DELETE ok', function(t) { @@ -452,15 +448,13 @@ test('DELETE ok', function(t) { method: 'DELETE', agent: false }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 204); - res.on('data', function(chunk) { - t.fail('Data was sent on 204'); - }); - t.end(); - }) - .end(); + http.request(opts, function(res) { + t.equal(res.statusCode, 204); + res.on('data', function(chunk) { + t.fail('Data was sent on 204'); + }); + t.end(); + }).end(); }); test('OPTIONS', function(t) { @@ -480,12 +474,10 @@ test('OPTIONS', function(t) { method: 'OPTIONS', agent: false }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 200); - t.end(); - }) - .end(); + http.request(opts, function(res) { + t.equal(res.statusCode, 200); + t.end(); + }).end(); }); test('RegExp ok', function(t) { @@ -544,20 +536,18 @@ test('GH-56 streaming with filed (download)', function(t) { method: 'GET', agent: false }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 200); - var body = ''; - res.setEncoding('utf8'); - res.on('data', function(chunk) { - body += chunk; - }); - res.on('end', function() { - t.ok(body.length > 0); - t.end(); - }); - }) - .end(); + http.request(opts, function(res) { + t.equal(res.statusCode, 200); + var body = ''; + res.setEncoding('utf8'); + res.on('data', function(chunk) { + body += chunk; + }); + res.on('end', function() { + t.ok(body.length > 0); + t.end(); + }); + }).end(); }); test('GH-63 res.send 204 is sending a body', function(t) { @@ -577,20 +567,18 @@ test('GH-63 res.send 204 is sending a body', function(t) { } }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 204); - var body = ''; - res.setEncoding('utf8'); - res.on('data', function(chunk) { - body += chunk; - }); - res.on('end', function() { - t.notOk(body); - t.end(); - }); - }) - .end(); + http.request(opts, function(res) { + t.equal(res.statusCode, 204); + var body = ''; + res.setEncoding('utf8'); + res.on('data', function(chunk) { + body += chunk; + }); + res.on('end', function() { + t.notOk(body); + t.end(); + }); + }).end(); }); test('GH-64 prerouting chain', function(t) { @@ -615,20 +603,18 @@ test('GH-64 prerouting chain', function(t) { accept: 'text/plain' } }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 200); - var body = ''; - res.setEncoding('utf8'); - res.on('data', function(chunk) { - body += chunk; - }); - res.on('end', function() { - t.equal(body, '"mark"'); - t.end(); - }); - }) - .end(); + http.request(opts, function(res) { + t.equal(res.statusCode, 200); + var body = ''; + res.setEncoding('utf8'); + res.on('data', function(chunk) { + body += chunk; + }); + res.on('end', function() { + t.equal(body, '"mark"'); + t.end(); + }); + }).end(); }); test('GH-64 prerouting chain with error', function(t) { @@ -723,20 +709,18 @@ test('GH-180 can parse DELETE body', function(t) { 'transfer-encoding': 'chunked' } }; - http - .request(opts, function(res) { - t.equal(res.statusCode, 200); - res.setEncoding('utf8'); - res.body = ''; - res.on('data', function(chunk) { - res.body += chunk; - }); - res.on('end', function() { - t.equal(res.body, '{"param1":1234}'); - t.end(); - }); - }) - .end('{"param1": 1234}'); + http.request(opts, function(res) { + t.equal(res.statusCode, 200); + res.setEncoding('utf8'); + res.body = ''; + res.on('data', function(chunk) { + res.body += chunk; + }); + res.on('end', function() { + t.equal(res.body, '{"param1":1234}'); + t.end(); + }); + }).end('{"param1": 1234}'); }); test('returning error from a handler (with domains)', function(t) { diff --git a/test/serverHttp2.test.js b/test/serverHttp2.test.js index 78de37901..00015a480 100644 --- a/test/serverHttp2.test.js +++ b/test/serverHttp2.test.js @@ -53,9 +53,12 @@ before(function(cb) { }); SERVER.listen(PORT, '127.0.0.1', function() { PORT = SERVER.address().port; - CLIENT = http2.connect('https://127.0.0.1:' + PORT, { - rejectUnauthorized: false - }); + CLIENT = http2.connect( + 'https://127.0.0.1:' + PORT, + { + rejectUnauthorized: false + } + ); cb(); }); diff --git a/test/upgrade.test.js b/test/upgrade.test.js index f674b1613..e23d4d21f 100644 --- a/test/upgrade.test.js +++ b/test/upgrade.test.js @@ -304,7 +304,12 @@ test('GET with upgrade headers', function(t) { t.equal(typeof socket, 'object'); t.ok(Buffer.isBuffer(head), 'head is Buffer'); t.doesNotThrow(function() { - var shed = WATERSHED.connect(res, socket, head, wskey); + var shed = WATERSHED.connect( + res, + socket, + head, + wskey + ); SHEDLIST.push(shed); shed.end('ok, done'); shed.on('error', function(err3) { @@ -375,7 +380,12 @@ test('GET with some websocket traffic', function(t) { t.equal(typeof socket, 'object'); t.ok(Buffer.isBuffer(head), 'head is Buffer'); t.doesNotThrow(function() { - var shed = WATERSHED.connect(res, socket, head, wskey); + var shed = WATERSHED.connect( + res, + socket, + head, + wskey + ); SHEDLIST.push(shed); shed.on('error', function(err3) { t.ifError(err3);