requestStart: Fix so requestEnded gets called with ctx
This commit is contained in:
parent
3a48c88c3a
commit
2d7b3ed440
2 changed files with 2 additions and 1 deletions
|
@ -403,7 +403,7 @@ export class Flaska {
|
||||||
ctx.aborted = true
|
ctx.aborted = true
|
||||||
})
|
})
|
||||||
req.on('close', () => {
|
req.on('close', () => {
|
||||||
this.requestEnded()
|
this.requestEnded(ctx)
|
||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -51,6 +51,7 @@ t.describe('#requestStart()', function() {
|
||||||
assert.strictEqual(onEnded.called, false)
|
assert.strictEqual(onEnded.called, false)
|
||||||
assertReq.on.thirdCall[1]()
|
assertReq.on.thirdCall[1]()
|
||||||
assert.strictEqual(onEnded.called, true)
|
assert.strictEqual(onEnded.called, true)
|
||||||
|
assert.strictEqual(onEnded.firstCall[0], ctx)
|
||||||
|
|
||||||
// Test abort and close
|
// Test abort and close
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue