Skip to content

Commit

Permalink
Fix indentation issues according to eslint@1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
simov committed Oct 30, 2015
1 parent 727b305 commit cceaa6e
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Expand Up @@ -4,7 +4,7 @@
},
"rules": {
// 2-space indentation
"indent": [2, 2],
"indent": [2, 2, {"SwitchCase": 1}],
// Disallow semi-colons, unless needed to disambiguate statement
"semi": [2, "never"],
// Require strings to use single quotes
Expand Down
100 changes: 50 additions & 50 deletions tests/test-body.js
Expand Up @@ -29,76 +29,76 @@ function addTest(name, data) {
}

addTest('testGet', {
resp : server.createGetResponse('TESTING!')
resp : server.createGetResponse('TESTING!')
, expectBody: 'TESTING!'
})

addTest('testGetChunkBreak', {
resp : server.createChunkResponse(
[ new Buffer([239])
, new Buffer([163])
, new Buffer([191])
, new Buffer([206])
, new Buffer([169])
, new Buffer([226])
, new Buffer([152])
, new Buffer([131])
])
resp : server.createChunkResponse(
[ new Buffer([239])
, new Buffer([163])
, new Buffer([191])
, new Buffer([206])
, new Buffer([169])
, new Buffer([226])
, new Buffer([152])
, new Buffer([131])
])
, expectBody: '\uF8FF\u03A9\u2603'
})

addTest('testGetBuffer', {
resp : server.createGetResponse(new Buffer('TESTING!'))
resp : server.createGetResponse(new Buffer('TESTING!'))
, encoding: null
, expectBody: new Buffer('TESTING!')
})

addTest('testGetEncoding', {
resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex'))
resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex'))
, encoding: 'hex'
, expectBody: 'efa3bfcea9e29883'
})

addTest('testGetUTF', {
resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131]))
, encoding: 'utf8'
, expectBody: '\u2603'
resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131]))
, encoding: 'utf8'
, expectBody: '\u2603'
})

addTest('testGetJSON', {
resp : server.createGetResponse('{"test":true}', 'application/json')
, json : true
, expectBody: {'test':true}
resp : server.createGetResponse('{"test":true}', 'application/json')
, json : true
, expectBody: {'test':true}
})

addTest('testPutString', {
resp : server.createPostValidator('PUTTINGDATA')
resp : server.createPostValidator('PUTTINGDATA')
, method : 'PUT'
, body : 'PUTTINGDATA'
})

addTest('testPutBuffer', {
resp : server.createPostValidator('PUTTINGDATA')
resp : server.createPostValidator('PUTTINGDATA')
, method : 'PUT'
, body : new Buffer('PUTTINGDATA')
})

addTest('testPutJSON', {
resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
, method: 'PUT'
, json: {foo: 'bar'}
})

addTest('testPutMultipart', {
resp: server.createPostValidator(
'--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--'
)
resp: server.createPostValidator(
'--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--'
)
, method: 'PUT'
, multipart:
[ {'content-type': 'text/html', 'body': '<html><body>Oh hi.</body></html>'}
Expand All @@ -107,15 +107,15 @@ addTest('testPutMultipart', {
})

addTest('testPutMultipartPreambleCRLF', {
resp: server.createPostValidator(
'\r\n--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--'
)
resp: server.createPostValidator(
'\r\n--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--'
)
, method: 'PUT'
, preambleCRLF: true
, multipart:
Expand All @@ -125,16 +125,16 @@ addTest('testPutMultipartPreambleCRLF', {
})

addTest('testPutMultipartPostambleCRLF', {
resp: server.createPostValidator(
'\r\n--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--' +
'\r\n'
)
resp: server.createPostValidator(
'\r\n--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--' +
'\r\n'
)
, method: 'PUT'
, preambleCRLF: true
, postambleCRLF: true
Expand Down
48 changes: 24 additions & 24 deletions tests/test-https.js
Expand Up @@ -50,58 +50,58 @@ function runAllTests(strict, s) {
}

runTest('testGet', {
resp : server.createGetResponse('TESTING!')
resp : server.createGetResponse('TESTING!')
, expectBody: 'TESTING!'
})

runTest('testGetChunkBreak', {
resp : server.createChunkResponse(
[ new Buffer([239])
, new Buffer([163])
, new Buffer([191])
, new Buffer([206])
, new Buffer([169])
, new Buffer([226])
, new Buffer([152])
, new Buffer([131])
])
resp : server.createChunkResponse(
[ new Buffer([239])
, new Buffer([163])
, new Buffer([191])
, new Buffer([206])
, new Buffer([169])
, new Buffer([226])
, new Buffer([152])
, new Buffer([131])
])
, expectBody: '\uf8ff\u03a9\u2603'
})

runTest('testGetJSON', {
resp : server.createGetResponse('{"test":true}', 'application/json')
resp : server.createGetResponse('{"test":true}', 'application/json')
, json : true
, expectBody: {'test':true}
})

runTest('testPutString', {
resp : server.createPostValidator('PUTTINGDATA')
resp : server.createPostValidator('PUTTINGDATA')
, method : 'PUT'
, body : 'PUTTINGDATA'
})

runTest('testPutBuffer', {
resp : server.createPostValidator('PUTTINGDATA')
resp : server.createPostValidator('PUTTINGDATA')
, method : 'PUT'
, body : new Buffer('PUTTINGDATA')
})

runTest('testPutJSON', {
resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
, method: 'PUT'
, json: {foo: 'bar'}
})

runTest('testPutMultipart', {
resp: server.createPostValidator(
'--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--'
)
resp: server.createPostValidator(
'--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
'\r\n--__BOUNDARY__\r\n\r\n' +
'Oh hi.' +
'\r\n--__BOUNDARY__--'
)
, method: 'PUT'
, multipart:
[ {'content-type': 'text/html', 'body': '<html><body>Oh hi.</body></html>'}
Expand Down
10 changes: 5 additions & 5 deletions tests/test-multipart.js
Expand Up @@ -72,11 +72,11 @@ function runTest(t, a) {

// @NOTE: multipartData properties must be set here so that my_file read stream does not leak in node v0.8
multipartData = [
{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:6767/file')}
]
{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:6767/file')}
]

var reqOptions = {
url: 'http://localhost:6767/upload',
Expand Down
72 changes: 36 additions & 36 deletions tests/test-oauth.js
Expand Up @@ -254,19 +254,19 @@ tape('rfc5849 example', function(t) {
var rfc5849 = request.post(
{ url: 'http://example.com/request?b5=%3D%253D&a3=a&c%40=&a2=r%20b'
, oauth:
{ consumer_key: '9djdj82h48djs9d2'
, nonce: '7d8f3e4a'
, signature_method: 'HMAC-SHA1'
, token: 'kkk9d7dh3k39sjv7'
, timestamp: '137131201'
, consumer_secret: 'j49sk3j29djd'
, token_secret: 'dh893hdasih9'
, realm: 'Example'
}
{ consumer_key: '9djdj82h48djs9d2'
, nonce: '7d8f3e4a'
, signature_method: 'HMAC-SHA1'
, token: 'kkk9d7dh3k39sjv7'
, timestamp: '137131201'
, consumer_secret: 'j49sk3j29djd'
, token_secret: 'dh893hdasih9'
, realm: 'Example'
}
, form: {
c2: '',
a3: '2 q'
}
c2: '',
a3: '2 q'
}
})

process.nextTick(function() {
Expand All @@ -291,9 +291,9 @@ tape('rfc5849 RSA example', function(t) {
, realm: 'Example'
}
, form: {
c2: '',
a3: '2 q'
}
c2: '',
a3: '2 q'
}
})

process.nextTick(function() {
Expand Down Expand Up @@ -412,9 +412,9 @@ tape('query transport_method + form option + url params', function(t) {
, transport_method: 'query'
}
, form: {
c2: '',
a3: '2 q'
}
c2: '',
a3: '2 q'
}
})

process.nextTick(function() {
Expand Down Expand Up @@ -454,10 +454,10 @@ tape('query transport_method + qs option + url params', function(t) {
, transport_method: 'query'
}
, qs: {
b5: '=%3D',
a3: ['a', '2 q'],
'c@': '',
c2: ''
b5: '=%3D',
a3: ['a', '2 q'],
'c@': '',
c2: ''
}
})

Expand Down Expand Up @@ -534,9 +534,9 @@ tape('body transport_method + form option + url params', function(t) {
, transport_method: 'body'
}
, form: {
c2: '',
a3: '2 q'
}
c2: '',
a3: '2 q'
}
})

process.nextTick(function() {
Expand Down Expand Up @@ -639,12 +639,12 @@ tape('refresh oauth_nonce on redirect', function(t) {
, token_secret: 'token_secret'
}
}, function (err, res, body) {
t.equal(err, null)
t.notEqual(oauth_nonce1, oauth_nonce2)
s.close(function () {
t.end()
})
t.equal(err, null)
t.notEqual(oauth_nonce1, oauth_nonce2)
s.close(function () {
t.end()
})
})
})
})

Expand All @@ -668,14 +668,14 @@ tape('no credentials on external redirect', function(t) {
, token_secret: 'token_secret'
}
}, function (err, res, body) {
t.equal(err, null)
t.equal(res.request.headers.Authorization, undefined)
s1.close(function () {
s2.close(function () {
t.end()
})
t.equal(err, null)
t.equal(res.request.headers.Authorization, undefined)
s1.close(function () {
s2.close(function () {
t.end()
})
})
})
})
})
})

0 comments on commit cceaa6e

Please sign in to comment.