Skip to content

Commit

Permalink
lint: apply standard 11 style
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Mar 31, 2018
1 parent b8a2d9b commit f2959f5
Show file tree
Hide file tree
Showing 6 changed files with 471 additions and 471 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"type-is": "~1.6.15"
},
"devDependencies": {
"eslint": "3.19.0",
"eslint-config-standard": "10.2.1",
"eslint-plugin-import": "2.8.0",
"eslint": "4.19.1",
"eslint-config-standard": "11.0.0",
"eslint-plugin-import": "2.9.0",
"eslint-plugin-markdown": "1.0.0-beta.6",
"eslint-plugin-node": "5.2.1",
"eslint-plugin-promise": "3.6.0",
"eslint-plugin-node": "6.0.1",
"eslint-plugin-promise": "3.7.0",
"eslint-plugin-standard": "3.0.1",
"istanbul": "0.4.5",
"methods": "1.1.2",
Expand Down
66 changes: 33 additions & 33 deletions test/body-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ describe('bodyParser()', function () {

it('should default to {}', function (done) {
request(this.server)
.post('/')
.expect(200, '{}', done)
.post('/')
.expect(200, '{}', done)
})

it('should parse JSON', function (done) {
request(this.server)
.post('/')
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(200, '{"user":"tobi"}', done)
.post('/')
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(200, '{"user":"tobi"}', done)
})

it('should parse x-www-form-urlencoded', function (done) {
request(this.server)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send('user=tobi')
.expect(200, '{"user":"tobi"}', done)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send('user=tobi')
.expect(200, '{"user":"tobi"}', done)
})

it('should handle duplicated middleware', function (done) {
Expand All @@ -45,10 +45,10 @@ describe('bodyParser()', function () {
})

request(server)
.post('/')
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(200, '{"user":"tobi"}', done)
.post('/')
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(200, '{"user":"tobi"}', done)
})

describe('http methods', function () {
Expand Down Expand Up @@ -79,9 +79,9 @@ describe('bodyParser()', function () {

it('should support ' + method.toUpperCase() + ' requests', function (done) {
request(this.server)[method]('/')
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(201, done)
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(201, done)
})
})
})
Expand All @@ -93,18 +93,18 @@ describe('bodyParser()', function () {

it('should parse JSON', function (done) {
request(this.server)
.post('/')
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(200, '{"user":"tobi"}', done)
.post('/')
.set('Content-Type', 'application/json')
.send('{"user":"tobi"}')
.expect(200, '{"user":"tobi"}', done)
})

it('should parse x-www-form-urlencoded', function (done) {
request(this.server)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send('user=tobi')
.expect(200, '{"user":"tobi"}', done)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send('user=tobi')
.expect(200, '{"user":"tobi"}', done)
})
})

Expand All @@ -115,10 +115,10 @@ describe('bodyParser()', function () {
}})

request(server)
.post('/')
.set('Content-Type', 'application/json')
.send(' {"user":"tobi"}')
.expect(403, 'no leading space', done)
.post('/')
.set('Content-Type', 'application/json')
.send(' {"user":"tobi"}')
.expect(403, 'no leading space', done)
})

it('should apply to urlencoded', function (done) {
Expand All @@ -127,10 +127,10 @@ describe('bodyParser()', function () {
}})

request(server)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send(' user=tobi')
.expect(403, 'no leading space', done)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send(' user=tobi')
.expect(403, 'no leading space', done)
})
})
})
Expand Down
Loading

0 comments on commit f2959f5

Please sign in to comment.