node_modules: update
This commit is contained in:
parent
4a21c51f2f
commit
b91baffed3
107 changed files with 3886 additions and 2943 deletions
58
node_modules/pino-std-serializers/test/req.test.js
generated
vendored
58
node_modules/pino-std-serializers/test/req.test.js
generated
vendored
|
@ -158,6 +158,25 @@ test('req.id has a non-function value with custom id function', function (t) {
|
|||
}
|
||||
})
|
||||
|
||||
test('req.url will be obtained from input request req.path when input request url is an object', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
var server = http.createServer(handler)
|
||||
server.unref()
|
||||
server.listen(0, () => {
|
||||
http.get(server.address(), () => {})
|
||||
})
|
||||
|
||||
t.tearDown(() => server.close())
|
||||
|
||||
function handler (req, res) {
|
||||
req.path = '/test'
|
||||
var serialized = serializers.reqSerializer(req)
|
||||
t.is(serialized.url, '/test')
|
||||
res.end()
|
||||
}
|
||||
})
|
||||
|
||||
test('req.url will be obtained from input request url.path when input request url is an object', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
|
@ -170,13 +189,50 @@ test('req.url will be obtained from input request url.path when input request ur
|
|||
t.tearDown(() => server.close())
|
||||
|
||||
function handler (req, res) {
|
||||
req.url = {path: '/test'}
|
||||
req.url = { path: '/test' }
|
||||
var serialized = serializers.reqSerializer(req)
|
||||
t.is(serialized.url, '/test')
|
||||
res.end()
|
||||
}
|
||||
})
|
||||
|
||||
test('req.url will be obtained from input request url when input request url is not an object', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
var server = http.createServer(handler)
|
||||
server.unref()
|
||||
server.listen(0, () => {
|
||||
http.get(server.address(), () => {})
|
||||
})
|
||||
|
||||
t.tearDown(() => server.close())
|
||||
|
||||
function handler (req, res) {
|
||||
req.url = '/test'
|
||||
var serialized = serializers.reqSerializer(req)
|
||||
t.is(serialized.url, '/test')
|
||||
res.end()
|
||||
}
|
||||
})
|
||||
|
||||
test('req.url will be empty when input request path and url are not defined', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
var server = http.createServer(handler)
|
||||
server.unref()
|
||||
server.listen(0, () => {
|
||||
http.get(server.address(), () => {})
|
||||
})
|
||||
|
||||
t.tearDown(() => server.close())
|
||||
|
||||
function handler (req, res) {
|
||||
var serialized = serializers.reqSerializer(req)
|
||||
t.is(serialized.url, '/')
|
||||
res.end()
|
||||
}
|
||||
})
|
||||
|
||||
test('req.url will be obtained from input request originalUrl when available', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue