Skip to content

Commit

Permalink
fix: fix all eslint warns
Browse files Browse the repository at this point in the history
  • Loading branch information
imed jaberi authored and miwnwski committed Jul 2, 2022
1 parent 29f20de commit 30242ee
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
32 changes: 16 additions & 16 deletions __tests__/application/respond.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('app.respond', () => {
.get('/')
.expect(200)

assert.strictEqual(res.headers.hasOwnProperty('Content-Type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})
})

Expand Down Expand Up @@ -329,7 +329,7 @@ describe('app.respond', () => {
.expect(204)
.expect('')

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})
})

Expand All @@ -348,7 +348,7 @@ describe('app.respond', () => {
.expect(205)
.expect('')

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})
})

Expand All @@ -367,7 +367,7 @@ describe('app.respond', () => {
.expect(304)
.expect('')

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})
})

Expand Down Expand Up @@ -444,7 +444,7 @@ describe('app.respond', () => {
.expect(204)
.expect('')

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})

it('should respond 204 with status=200', async () => {
Expand All @@ -462,7 +462,7 @@ describe('app.respond', () => {
.expect(204)
.expect('')

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})

it('should respond 205 with status=205', async () => {
Expand All @@ -480,7 +480,7 @@ describe('app.respond', () => {
.expect(205)
.expect('')

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})

it('should respond 304 with status=304', async () => {
Expand All @@ -498,7 +498,7 @@ describe('app.respond', () => {
.expect(304)
.expect('')

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})
})

Expand Down Expand Up @@ -551,7 +551,7 @@ describe('app.respond', () => {
.expect('Content-Type', 'application/json; charset=utf-8')

const pkg = require('../../package')
assert.strictEqual(res.headers.hasOwnProperty('content-length'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-length'), false)
assert.deepStrictEqual(res.body, pkg)
})

Expand All @@ -571,7 +571,7 @@ describe('app.respond', () => {
.expect('Content-Type', 'application/json; charset=utf-8')

const pkg = require('../../package')
assert.strictEqual(res.headers.hasOwnProperty('content-length'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-length'), false)
assert.deepStrictEqual(res.body, pkg)
})

Expand All @@ -591,7 +591,7 @@ describe('app.respond', () => {
.expect('Content-Type', 'application/json; charset=utf-8')

const pkg = require('../../package')
assert.strictEqual(res.headers.hasOwnProperty('content-length'), true)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-length'), true)
assert.deepStrictEqual(res.body, pkg)
})

Expand All @@ -614,7 +614,7 @@ describe('app.respond', () => {
.expect('Content-Type', 'application/json; charset=utf-8')

const pkg = require('../../package')
assert.strictEqual(res.headers.hasOwnProperty('content-length'), true)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-length'), true)
assert.deepStrictEqual(res.body, pkg)
})

Expand Down Expand Up @@ -829,7 +829,7 @@ describe('app.respond', () => {
.get('/')
.expect(204)

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
})
})

Expand Down Expand Up @@ -866,9 +866,9 @@ describe('app.respond', () => {
.expect('')
.expect({})

assert.equal(res.headers.hasOwnProperty('transfer-encoding'), false)
assert.equal(res.headers.hasOwnProperty('content-type'), false)
assert.equal(res.headers.hasOwnProperty('content-length'), true)
assert.equal(Object.prototype.hasOwnProperty.call(res.headers, 'transfer-encoding'), false)
assert.equal(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
assert.equal(Object.prototype.hasOwnProperty.call(res.headers, 'content-length'), true)
})

it('should return content-length equal to 0', async () => {
Expand Down
8 changes: 4 additions & 4 deletions __tests__/context/onerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ describe('ctx.onerror(err)', () => {
.expect('Content-Type', 'text/plain; charset=utf-8')
.expect('Content-Length', '4')

assert.strictEqual(res.headers.hasOwnProperty('vary'), false)
assert.strictEqual(res.headers.hasOwnProperty('x-csrf-token'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'vary'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'x-csrf-token'), false)
})

it('should set headers specified in the error', async () => {
Expand Down Expand Up @@ -72,8 +72,8 @@ describe('ctx.onerror(err)', () => {
.expect('Content-Type', 'text/plain; charset=utf-8')
.expect('X-New-Header', 'Value')

assert.strictEqual(res.headers.hasOwnProperty('vary'), false)
assert.strictEqual(res.headers.hasOwnProperty('x-csrf-token'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'vary'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'x-csrf-token'), false)
})

it('should ignore error after headerSent', done => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/load-with-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe.skip('Load with esm', () => {

it('CommonJS exports default property', async () => {
const required = require('../')
assert.strictEqual(required.hasOwnProperty('default'), true)
assert.strictEqual(Object.prototype.hasOwnProperty.call(required, 'default'), true)
})

it('CommonJS exports default property referencing self', async () => {
Expand Down
12 changes: 6 additions & 6 deletions __tests__/response/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ describe('res.status=', () => {
.get('/')
.expect(status)

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(res.headers.hasOwnProperty('content-length'), false)
assert.strictEqual(res.headers.hasOwnProperty('content-encoding'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-length'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-encoding'), false)
assert.strictEqual(res.text.length, 0)
})

Expand All @@ -101,9 +101,9 @@ describe('res.status=', () => {
.get('/')
.expect(status)

assert.strictEqual(res.headers.hasOwnProperty('content-type'), false)
assert.strictEqual(res.headers.hasOwnProperty('content-length'), false)
assert.strictEqual(res.headers.hasOwnProperty('content-encoding'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'Content-Type'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-length'), false)
assert.strictEqual(Object.prototype.hasOwnProperty.call(res.headers, 'content-encoding'), false)
assert.strictEqual(res.text.length, 0)
})
}
Expand Down

0 comments on commit 30242ee

Please sign in to comment.