-
Notifications
You must be signed in to change notification settings - Fork 15
Fix logging handling in hapi log events + added tests #131
Conversation
test/instrumentation/modules/hapi.js
Outdated
|
||
server.log(['error'], customError) | ||
|
||
agent._instrumentation._queue._flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to flush the transaction queue here because this test doesn't test anything related to transactions. Just remove this line and don't give any arguments to the resetAgent
function. Then just move the call to server.stop()
to the top of the mocked captureError
function.
test/instrumentation/modules/hapi.js
Outdated
|
||
server.log(['error'], customError) | ||
|
||
agent._instrumentation._queue._flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/instrumentation/modules/hapi.js
Outdated
|
||
server.log(['error'], customError) | ||
|
||
agent._instrumentation._queue._flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/instrumentation/modules/hapi.js
Outdated
t.equal(res.statusCode, 200) | ||
|
||
res.on('data', function (chunck) { | ||
// I need to read this to make `res` end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little cleaner to just call res.resume()
(that will also put the stream into flowing mode)
…ransactions // Use res.resume to flow through stream better
test/instrumentation/modules/hapi.js
Outdated
t.equal(res.statusCode, 200) | ||
|
||
res.on('data', function (chunck) { | ||
// I need to read this to make `res` end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little cleaner to just call res.resume()
(that will also put the stream into flowing mode)
test/instrumentation/modules/hapi.js
Outdated
t.equal(res.statusCode, 200) | ||
|
||
res.on('data', function (chunck) { | ||
// I need to read this to make `res` end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little cleaner to just call res.resume()
(that will also put the stream into flowing mode)
Really awesome job with all the test @AdriVanHoudt 😃 In general they all look good. I've added a few comments with some minor changes. Nothing big - just a few things to tidy things up |
@watson I was just looking at this PR for comments so I fixed all the notes already 🚀 |
I'll wait releasing this until your other PR have been merged as well |
@watson thanks! |
Published as v4.12.0 |
connectionless tests should not run before 15.0.2. server.stop(...) requires a stop callback until 10.x.
I think I did all the tests right ^^