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 Apr 2, 2018
1 parent cf7582e commit 5b396e3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
},
"devDependencies": {
"after": "0.8.2",
"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.10.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",
"mocha": "2.5.3",
Expand Down
58 changes: 29 additions & 29 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ describe('responseTime()', function () {
it('should send X-Response-Time header', function (done) {
var server = createServer()
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9.]+ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9.]+ms$/, done)
})

it('should not override X-Response-Time header', function (done) {
Expand All @@ -21,30 +21,30 @@ describe('responseTime()', function () {
})

request(server)
.get('/')
.expect('X-Response-Time', 'bogus', done)
.get('/')
.expect('X-Response-Time', 'bogus', done)
})

describe('with "digits"', function () {
it('should default to 3', function (done) {
var server = createServer()
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{3}ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{3}ms$/, done)
})

it('should allow custom digits', function (done) {
var server = createServer(5)
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{5}ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{5}ms$/, done)
})

it('should allow no digits', function (done) {
var server = createServer(0)
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9]+ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9]+ms$/, done)
})
})
})
Expand All @@ -64,8 +64,8 @@ describe('responseTime(fn)', function () {
})

request(server)
.get('/')
.expect(200, cb)
.get('/')
.expect(200, cb)
})

it('should not send X-Response-Time header', function (done) {
Expand All @@ -75,9 +75,9 @@ describe('responseTime(fn)', function () {
})

request(server)
.get('/')
.expect(shouldNotHaveHeader('X-Response-Time'))
.expect(200, cb)
.get('/')
.expect(shouldNotHaveHeader('X-Response-Time'))
.expect(200, cb)
})
})

Expand All @@ -86,54 +86,54 @@ describe('responseTime(options)', function () {
it('should default to 3', function (done) {
var server = createServer()
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{3}ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{3}ms$/, done)
})

it('should allow custom digits', function (done) {
var server = createServer({ digits: 5 })
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{5}ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9]+\.[0-9]{5}ms$/, done)
})

it('should allow no digits', function (done) {
var server = createServer({ digits: 0 })
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9]+ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9]+ms$/, done)
})
})

describe('with "header" option', function () {
it('should default to X-Response-Time', function (done) {
var server = createServer()
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9.]+ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9.]+ms$/, done)
})

it('should allow custom header name', function (done) {
var server = createServer({ header: 'X-Time-Taken' })
request(server)
.get('/')
.expect('X-Time-Taken', /^[0-9.]+ms$/, done)
.get('/')
.expect('X-Time-Taken', /^[0-9.]+ms$/, done)
})
})

describe('with "suffix" option', function () {
it('should default to true', function (done) {
var server = createServer()
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9.]+ms$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9.]+ms$/, done)
})

it('should allow disabling suffix', function (done) {
var server = createServer({ suffix: false })
request(server)
.get('/')
.expect('X-Response-Time', /^[0-9.]+$/, done)
.get('/')
.expect('X-Response-Time', /^[0-9.]+$/, done)
})
})
})
Expand Down

0 comments on commit 5b396e3

Please sign in to comment.