Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update http-errors to v2.0.0 #1486

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/application/use.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('app.use(fn)', () => {
it('should catch thrown errors in non-async functions', () => {
const app = new Koa()

app.use(ctx => ctx.throw('Not Found', 404))
app.use(ctx => ctx.throw(404, 'Not Found'))

return request(app.callback())
.get('/')
Expand Down
4 changes: 2 additions & 2 deletions __tests__/context/throw.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('ctx.throw(err, status)', () => {
const error = new Error('test')

try {
ctx.throw(error, 422)
ctx.throw(422, error)
} catch (err) {
assert.strictEqual(err.status, 422)
assert.strictEqual(err.message, 'test')
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('ctx.throw(msg, status)', () => {
const ctx = context()

try {
ctx.throw('name required', 400)
ctx.throw(400, 'name required')
} catch (err) {
assert.strictEqual(err.message, 'name required')
assert.strictEqual(err.status, 400)
Expand Down
93 changes: 68 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"escape-html": "^1.0.3",
"fresh": "~0.5.2",
"http-assert": "^1.3.0",
"http-errors": "^1.6.3",
3imed-jaberi marked this conversation as resolved.
Show resolved Hide resolved
"http-errors": "^2.0.0",
"koa-compose": "^4.1.0",
"on-finished": "^2.3.0",
"only": "~0.0.2",
Expand Down Expand Up @@ -74,4 +74,4 @@
"jest": {
"testEnvironment": "node"
}
}
}