Comparing version 1.1.0 to 1.1.1
@@ -38,3 +38,3 @@ 'use strict' | ||
err: err, | ||
responseTime: this.responseTime | ||
responseTime: responseTime | ||
}, 'request errored') | ||
@@ -41,0 +41,0 @@ return |
{ | ||
"name": "pino-http", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "High-speed HTTP logger for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "logger.js", |
28
test.js
@@ -112,3 +112,2 @@ 'use strict' | ||
var server = http.createServer(handle) | ||
function handle (req, res) { | ||
@@ -121,10 +120,25 @@ logger(req, res) | ||
t.tearDown(function (cb) { | ||
server.close(cb) | ||
}) | ||
expectResponseTime(t, dest, logger, handle) | ||
}) | ||
server.listen(0, '127.0.0.1', function (err) { | ||
test('responseTime for errored request', function (t) { | ||
var dest = split(JSON.parse) | ||
var logger = pinoLogger(dest) | ||
function handle (req, res) { | ||
logger(req, res) | ||
setTimeout(function () { | ||
res.emit('error', new Error('Some error')) | ||
res.end() | ||
}, 100) | ||
} | ||
expectResponseTime(t, dest, logger, handle) | ||
}) | ||
function expectResponseTime (t, dest, logger, handle) { | ||
setup(t, logger, function (err, server) { | ||
t.error(err) | ||
doGet(server) | ||
}) | ||
}, handle) | ||
@@ -136,3 +150,3 @@ dest.on('data', function (line) { | ||
}) | ||
}) | ||
} | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11693
255
9