more debug code for circleci

dev
Jonatan Nilsson 2021-10-11 01:40:18 +00:00
parent d601ce169d
commit 36c45c9353
2 changed files with 7 additions and 6 deletions

View File

@ -16,16 +16,16 @@ app.before(function(ctx) {
})
app.after(function(ctx) {
console.log({
path: ctx.url,
status: ctx.status,
ms: Math.round(ended),
}, 'Request finished')
let ended = performance.now() - ctx.__started
let logger = ctx.log.info
if (ctx.status >= 400) {
logger = ctx.log.warn
}
console.log({
path: ctx.url,
status: ctx.status,
ms: Math.round(ended),
}, 'Request finished')
logger({
path: ctx.url,
status: ctx.status,

View File

@ -44,7 +44,8 @@ t.describe('Media (API)', () => {
setTimeout(res, 100)
})
console.log(server.log.warn)
console.log(server.log.warn.firstCall)
console.log(server.log.warn.secondCall)
assert.strictEqual(server.log.error.callCount, 0)
assert.strictEqual(server.log.warn.callCount, 2)
assert.strictEqual(typeof(server.log.warn.firstCall[0]), 'string')