Skip to content

Commit

Permalink
fix test with v2.x chnages
Browse files Browse the repository at this point in the history
  • Loading branch information
imed jaberi committed Apr 2, 2022
1 parent fb81438 commit 6ead024
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 6ead024

Please sign in to comment.