From a849e15fa4cdb2bcd1ef70150a3e476b2002bedd Mon Sep 17 00:00:00 2001 From: James Nylen Date: Tue, 6 Jan 2015 11:00:12 -0600 Subject: [PATCH] Standardize test ports on 6767 This is a less commonly used port than 8080 so it is less likely to conflict with other services. See discussion at #1327. --- tests/test-form-data.js | 8 ++++---- tests/test-form.js | 8 ++++---- tests/test-multipart.js | 8 ++++---- tests/test-piped-redirect.js | 4 ++-- tests/test-rfc3986.js | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/test-form-data.js b/tests/test-form-data.js index 16bf8934d..8b09ea17f 100644 --- a/tests/test-form-data.js +++ b/tests/test-form-data.js @@ -58,7 +58,7 @@ function runTest(t, json) { t.ok( data.indexOf('form-data; name="batch"') !== -1 ) t.ok( data.match(/form-data; name="batch"/g).length === 2 ) - // check for http://localhost:8080/file traces + // check for http://localhost:6767/file traces t.ok( data.indexOf('Photoshop ICC') !== -1 ) t.ok( data.indexOf('Content-Type: ' + mime.lookup(remoteFile) ) !== -1 ) @@ -67,13 +67,13 @@ function runTest(t, json) { }) }) - server.listen(8080, function() { + server.listen(6767, function() { // @NOTE: multipartFormData properties must be set here so that my_file read stream does not leak in node v0.8 multipartFormData.my_field = 'my_value' multipartFormData.my_buffer = new Buffer([1, 2, 3]) multipartFormData.my_file = fs.createReadStream(localFile) - multipartFormData.remote_file = request('http://localhost:8080/file') + multipartFormData.remote_file = request('http://localhost:6767/file') multipartFormData.secret_file = { value: fs.createReadStream(localFile), options: { @@ -87,7 +87,7 @@ function runTest(t, json) { ] var reqOptions = { - url: 'http://localhost:8080/upload', + url: 'http://localhost:6767/upload', formData: multipartFormData } if (json) { diff --git a/tests/test-form.js b/tests/test-form.js index 75f12f95e..0c4ef3959 100644 --- a/tests/test-form.js +++ b/tests/test-form.js @@ -55,7 +55,7 @@ tape('multipart form append', function(t) { field = FIELDS.shift() t.ok( data.indexOf('form-data; name="' + field.name + '"') !== -1 ) t.ok( data.indexOf('; filename="' + path.basename(field.value.path) + '"') !== -1 ) - // check for http://localhost:8080/file traces + // check for http://localhost:6767/file traces t.ok( data.indexOf('Photoshop ICC') !== -1 ) t.ok( data.indexOf('Content-Type: ' + mime.lookup(remoteFile) ) !== -1 ) @@ -68,16 +68,16 @@ tape('multipart form append', function(t) { }) }) - server.listen(8080, function() { + server.listen(6767, function() { FIELDS = [ { name: 'my_field', value: 'my_value' }, { name: 'my_buffer', value: new Buffer([1, 2, 3]) }, { name: 'my_file', value: fs.createReadStream(localFile) }, - { name: 'remote_file', value: request('http://localhost:8080/file') } + { name: 'remote_file', value: request('http://localhost:6767/file') } ] - var req = request.post('http://localhost:8080/upload', function(err, res, body) { + var req = request.post('http://localhost:6767/upload', function(err, res, body) { t.equal(err, null) t.equal(res.statusCode, 200) t.equal(body, 'done') diff --git a/tests/test-multipart.js b/tests/test-multipart.js index 6f0bf015c..cd7d659aa 100644 --- a/tests/test-multipart.js +++ b/tests/test-multipart.js @@ -60,7 +60,7 @@ function runTest(t, a) { // 4th field : remote_file t.ok( data.indexOf('name: remote_file') !== -1 ) - // check for http://localhost:8080/file traces + // check for http://localhost:6767/file traces t.ok( data.indexOf('Photoshop ICC') !== -1 ) } @@ -69,7 +69,7 @@ function runTest(t, a) { }) }) - server.listen(8080, function() { + server.listen(6767, function() { // @NOTE: multipartData properties must be set here so that my_file read stream does not leak in node v0.8 multipartData = chunked @@ -77,7 +77,7 @@ function runTest(t, a) { {name: 'my_field', body: 'my_value'}, {name: 'my_buffer', body: new Buffer([1, 2, 3])}, {name: 'my_file', body: fs.createReadStream(localFile)}, - {name: 'remote_file', body: request('http://localhost:8080/file')} + {name: 'remote_file', body: request('http://localhost:6767/file')} ] : [ {name: 'my_field', body: 'my_value'}, @@ -85,7 +85,7 @@ function runTest(t, a) { ] var reqOptions = { - url: 'http://localhost:8080/upload', + url: 'http://localhost:6767/upload', headers: (function () { var headers = {} if (a.mixed) { diff --git a/tests/test-piped-redirect.js b/tests/test-piped-redirect.js index d634ab2a0..07b904c55 100644 --- a/tests/test-piped-redirect.js +++ b/tests/test-piped-redirect.js @@ -4,8 +4,8 @@ var http = require('http') , request = require('../index') , tape = require('tape') -var port1 = 8968 - , port2 = 8969 +var port1 = 6767 + , port2 = 6768 var s1 = http.createServer(function(req, resp) { if (req.url === '/original') { diff --git a/tests/test-rfc3986.js b/tests/test-rfc3986.js index f8cdca1a2..8f2be26b0 100644 --- a/tests/test-rfc3986.js +++ b/tests/test-rfc3986.js @@ -40,9 +40,9 @@ function runTest (t, options) { }) }) - server.listen(8080, function() { + server.listen(6767, function() { - request.post('http://localhost:8080', options, function(err, res, body) { + request.post('http://localhost:6767', options, function(err, res, body) { t.equal(err, null) server.close(function() { t.end()