Skip to content

Commit 6ead024

Browse files
author
imed jaberi
committed
fix test with v2.x chnages
1 parent fb81438 commit 6ead024

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

__tests__/application/use.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('app.use(fn)', () => {
7777
it('should catch thrown errors in non-async functions', () => {
7878
const app = new Koa()
7979

80-
app.use(ctx => ctx.throw('Not Found', 404))
80+
app.use(ctx => ctx.throw(404, 'Not Found'))
8181

8282
return request(app.callback())
8383
.get('/')

__tests__/context/throw.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('ctx.throw(err, status)', () => {
3838
const error = new Error('test')
3939

4040
try {
41-
ctx.throw(error, 422)
41+
ctx.throw(422, error)
4242
} catch (err) {
4343
assert.strictEqual(err.status, 422)
4444
assert.strictEqual(err.message, 'test')
@@ -67,7 +67,7 @@ describe('ctx.throw(msg, status)', () => {
6767
const ctx = context()
6868

6969
try {
70-
ctx.throw('name required', 400)
70+
ctx.throw(400, 'name required')
7171
} catch (err) {
7272
assert.strictEqual(err.message, 'name required')
7373
assert.strictEqual(err.status, 400)

0 commit comments

Comments
 (0)