Skip to content

Commit 3a93328

Browse files
committed
lint: apply standard 11 style
1 parent 06e69b1 commit 3a93328

File tree

2 files changed

+87
-87
lines changed

2 files changed

+87
-87
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
"safe-buffer": "5.1.1"
1919
},
2020
"devDependencies": {
21-
"eslint": "3.19.0",
22-
"eslint-config-standard": "10.2.1",
23-
"eslint-plugin-import": "2.8.0",
21+
"eslint": "4.19.1",
22+
"eslint-config-standard": "11.0.0",
23+
"eslint-plugin-import": "2.9.0",
2424
"eslint-plugin-markdown": "1.0.0-beta.6",
25-
"eslint-plugin-node": "5.2.1",
26-
"eslint-plugin-promise": "3.6.0",
25+
"eslint-plugin-node": "6.0.1",
26+
"eslint-plugin-promise": "3.7.0",
2727
"eslint-plugin-standard": "3.0.1",
2828
"istanbul": "0.4.5",
2929
"mocha": "2.5.3",

test/test.js

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -42,65 +42,65 @@ describe('favicon()', function () {
4242
it('should be in cache-control', function (done) {
4343
var server = createServer(null, {maxAge: 5000})
4444
request(server)
45-
.get('/favicon.ico')
46-
.expect('Cache-Control', 'public, max-age=5')
47-
.expect(200, done)
45+
.get('/favicon.ico')
46+
.expect('Cache-Control', 'public, max-age=5')
47+
.expect(200, done)
4848
})
4949

5050
it('should have a default', function (done) {
5151
var server = createServer()
5252
request(server)
53-
.get('/favicon.ico')
54-
.expect('Cache-Control', /public, max-age=[0-9]+/)
55-
.expect(200, done)
53+
.get('/favicon.ico')
54+
.expect('Cache-Control', /public, max-age=[0-9]+/)
55+
.expect(200, done)
5656
})
5757

5858
it('should accept 0', function (done) {
5959
var server = createServer(null, {maxAge: 0})
6060
request(server)
61-
.get('/favicon.ico')
62-
.expect('Cache-Control', 'public, max-age=0')
63-
.expect(200, done)
61+
.get('/favicon.ico')
62+
.expect('Cache-Control', 'public, max-age=0')
63+
.expect(200, done)
6464
})
6565

6666
it('should accept string', function (done) {
6767
var server = createServer(null, {maxAge: '30d'})
6868
request(server)
69-
.get('/favicon.ico')
70-
.expect('Cache-Control', 'public, max-age=2592000')
71-
.expect(200, done)
69+
.get('/favicon.ico')
70+
.expect('Cache-Control', 'public, max-age=2592000')
71+
.expect(200, done)
7272
})
7373

7474
it('should be valid delta-seconds', function (done) {
7575
var server = createServer(null, {maxAge: 1234})
7676
request(server)
77-
.get('/favicon.ico')
78-
.expect('Cache-Control', 'public, max-age=1')
79-
.expect(200, done)
77+
.get('/favicon.ico')
78+
.expect('Cache-Control', 'public, max-age=1')
79+
.expect(200, done)
8080
})
8181

8282
it('should floor at 0', function (done) {
8383
var server = createServer(null, {maxAge: -4000})
8484
request(server)
85-
.get('/favicon.ico')
86-
.expect('Cache-Control', 'public, max-age=0')
87-
.expect(200, done)
85+
.get('/favicon.ico')
86+
.expect('Cache-Control', 'public, max-age=0')
87+
.expect(200, done)
8888
})
8989

9090
it('should ceil at 1 year', function (done) {
9191
var server = createServer(null, {maxAge: 900000000000})
9292
request(server)
93-
.get('/favicon.ico')
94-
.expect('Cache-Control', 'public, max-age=31536000')
95-
.expect(200, done)
93+
.get('/favicon.ico')
94+
.expect('Cache-Control', 'public, max-age=31536000')
95+
.expect(200, done)
9696
})
9797

9898
it('should accept Inifnity', function (done) {
9999
var server = createServer(null, {maxAge: Infinity})
100100
request(server)
101-
.get('/favicon.ico')
102-
.expect('Cache-Control', 'public, max-age=31536000')
103-
.expect(200, done)
101+
.get('/favicon.ico')
102+
.expect('Cache-Control', 'public, max-age=31536000')
103+
.expect(200, done)
104104
})
105105
})
106106
})
@@ -112,76 +112,76 @@ describe('favicon()', function () {
112112

113113
it('should serve icon', function (done) {
114114
request(this.server)
115-
.get('/favicon.ico')
116-
.expect('Content-Type', 'image/x-icon')
117-
.expect(200, done)
115+
.get('/favicon.ico')
116+
.expect('Content-Type', 'image/x-icon')
117+
.expect(200, done)
118118
})
119119

120120
it('should include cache-control', function (done) {
121121
request(this.server)
122-
.get('/favicon.ico')
123-
.expect('Cache-Control', /public/)
124-
.expect(200, done)
122+
.get('/favicon.ico')
123+
.expect('Cache-Control', /public/)
124+
.expect(200, done)
125125
})
126126

127127
it('should include strong etag', function (done) {
128128
request(this.server)
129-
.get('/favicon.ico')
130-
.expect('ETag', /^"[^"]+"$/)
131-
.expect(200, done)
129+
.get('/favicon.ico')
130+
.expect('ETag', /^"[^"]+"$/)
131+
.expect(200, done)
132132
})
133133

134134
it('should deny POST', function (done) {
135135
request(this.server)
136-
.post('/favicon.ico')
137-
.expect('Allow', 'GET, HEAD, OPTIONS')
138-
.expect(405, done)
136+
.post('/favicon.ico')
137+
.expect('Allow', 'GET, HEAD, OPTIONS')
138+
.expect(405, done)
139139
})
140140

141141
it('should understand OPTIONS', function (done) {
142142
request(this.server)
143-
.options('/favicon.ico')
144-
.expect('Allow', 'GET, HEAD, OPTIONS')
145-
.expect(200, done)
143+
.options('/favicon.ico')
144+
.expect('Allow', 'GET, HEAD, OPTIONS')
145+
.expect(200, done)
146146
})
147147

148148
it('should 304 when If-None-Match matches', function (done) {
149149
var server = this.server
150150
request(server)
151-
.get('/favicon.ico')
152-
.expect(200, function (err, res) {
153-
if (err) return done(err)
154-
request(server)
155151
.get('/favicon.ico')
156-
.set('If-None-Match', res.headers.etag)
157-
.expect(304, done)
158-
})
152+
.expect(200, function (err, res) {
153+
if (err) return done(err)
154+
request(server)
155+
.get('/favicon.ico')
156+
.set('If-None-Match', res.headers.etag)
157+
.expect(304, done)
158+
})
159159
})
160160

161161
it('should 304 when If-None-Match matches weakly', function (done) {
162162
var server = this.server
163163
request(server)
164-
.get('/favicon.ico')
165-
.expect(200, function (err, res) {
166-
if (err) return done(err)
167-
request(server)
168164
.get('/favicon.ico')
169-
.set('If-None-Match', 'W/' + res.headers.etag)
170-
.expect(304, done)
171-
})
165+
.expect(200, function (err, res) {
166+
if (err) return done(err)
167+
request(server)
168+
.get('/favicon.ico')
169+
.set('If-None-Match', 'W/' + res.headers.etag)
170+
.expect(304, done)
171+
})
172172
})
173173

174174
it('should ignore non-favicon requests', function (done) {
175175
request(this.server)
176-
.get('/')
177-
.expect(404, 'oops', done)
176+
.get('/')
177+
.expect(404, 'oops', done)
178178
})
179179

180180
it('should work with query string', function (done) {
181181
request(this.server)
182-
.get('/favicon.ico?v=1')
183-
.expect('Content-Type', 'image/x-icon')
184-
.expect(200, done)
182+
.get('/favicon.ico?v=1')
183+
.expect('Content-Type', 'image/x-icon')
184+
.expect(200, done)
185185
})
186186

187187
describe('missing req.url', function () {
@@ -209,23 +209,23 @@ describe('favicon()', function () {
209209
var server = createServer(icon.path)
210210

211211
request(server)
212-
.get('/favicon.ico')
213-
.expect(200, icon.data, done)
212+
.get('/favicon.ico')
213+
.expect(200, icon.data, done)
214214
})
215215

216216
it('should cache for second request', function (done) {
217217
var icon = this.icon
218218
var server = createServer(icon.path)
219219

220220
request(server)
221-
.get('/favicon.ico')
222-
.expect(200, icon.data, function (err) {
223-
if (err) return done(err)
224-
icon.unlinkSync()
225-
request(server)
226221
.get('/favicon.ico')
227-
.expect(200, icon.data, done)
228-
})
222+
.expect(200, icon.data, function (err) {
223+
if (err) return done(err)
224+
icon.unlinkSync()
225+
request(server)
226+
.get('/favicon.ico')
227+
.expect(200, icon.data, done)
228+
})
229229
})
230230
})
231231

@@ -246,8 +246,8 @@ describe('favicon()', function () {
246246

247247
icon.unlinkSync()
248248
request(server)
249-
.get('/favicon.ico')
250-
.expect(500, /ENOENT/, done)
249+
.get('/favicon.ico')
250+
.expect(500, /ENOENT/, done)
251251
})
252252

253253
it('should retry reading file after error', function (done) {
@@ -256,14 +256,14 @@ describe('favicon()', function () {
256256

257257
icon.unlinkSync()
258258
request(server)
259-
.get('/favicon.ico')
260-
.expect(500, /ENOENT/, function (err) {
261-
if (err) return done(err)
262-
icon.writeSync()
263-
request(server)
264259
.get('/favicon.ico')
265-
.expect(200, icon.data, done)
266-
})
260+
.expect(500, /ENOENT/, function (err) {
261+
if (err) return done(err)
262+
icon.writeSync()
263+
request(server)
264+
.get('/favicon.ico')
265+
.expect(200, icon.data, done)
266+
})
267267
})
268268
})
269269

@@ -273,9 +273,9 @@ describe('favicon()', function () {
273273
var server = createServer(buffer)
274274

275275
request(server)
276-
.get('/favicon.ico')
277-
.expect('Content-Length', '20')
278-
.expect(200, buffer, done)
276+
.get('/favicon.ico')
277+
.expect('Content-Length', '20')
278+
.expect(200, buffer, done)
279279
})
280280

281281
it('should be copied', function (done) {
@@ -287,9 +287,9 @@ describe('favicon()', function () {
287287
assert.equal(buffer.toString(), '????????????????????')
288288

289289
request(server)
290-
.get('/favicon.ico')
291-
.expect('Content-Length', '20')
292-
.expect(200, Buffer.from('####################'), done)
290+
.get('/favicon.ico')
291+
.expect('Content-Length', '20')
292+
.expect(200, Buffer.from('####################'), done)
293293
})
294294
})
295295
})

0 commit comments

Comments
 (0)