ctx: Add missing log to context
This commit is contained in:
parent
91588fc3ee
commit
6569ff75de
2 changed files with 5 additions and 1 deletions
|
@ -371,6 +371,7 @@ export class Flaska {
|
|||
}
|
||||
|
||||
let ctx = {
|
||||
log: this.log,
|
||||
req: req,
|
||||
res: res,
|
||||
method: req.method,
|
||||
|
|
|
@ -125,7 +125,9 @@ t.describe('#requestStart()', function() {
|
|||
const assertMethod = 'test'
|
||||
const assertPath = '/test/me'
|
||||
const assertSearch = '?asdf=test'
|
||||
let flaska = new Flaska({}, faker)
|
||||
const assertLog = { info: function() {}, error: function() {} }
|
||||
let flaska = new Flaska({ log: assertLog }, faker)
|
||||
assert.strictEqual(flaska.log, assertLog)
|
||||
flaska.compile()
|
||||
|
||||
flaska.routers.test = {
|
||||
|
@ -148,6 +150,7 @@ t.describe('#requestStart()', function() {
|
|||
assert.strictEqual(ctx.body, null)
|
||||
assert.strictEqual(ctx.type, null)
|
||||
assert.strictEqual(ctx.length, null)
|
||||
assert.strictEqual(ctx.log, assertLog)
|
||||
cb()
|
||||
} catch (err) { cb(err) }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue