@@ -151,7 +151,7 @@ test('connectionless server error logging with Error', function (t) {
151151 return ;
152152 }
153153
154- t . plan ( 6 ) ;
154+ t . plan ( 5 ) ;
155155
156156 var customError = new Error ( 'custom error' ) ;
157157
@@ -163,8 +163,7 @@ test('connectionless server error logging with Error', function (t) {
163163 t . strictEqual ( err , customError ) ;
164164 t . ok ( opts . custom ) ;
165165 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
166- t . false ( opts . custom . internals ) ;
167- t . ok ( opts . custom . data instanceof Error ) ;
166+ t . strictEqual ( opts . custom . data , undefined ) ;
168167 } ;
169168
170169 var server = makeServer ( ) ;
@@ -182,7 +181,7 @@ test('connectionless server error logging with String', function (t) {
182181 return ;
183182 }
184183
185- t . plan ( 6 ) ;
184+ t . plan ( 5 ) ;
186185
187186 var customError = 'custom error' ;
188187
@@ -194,8 +193,7 @@ test('connectionless server error logging with String', function (t) {
194193 t . strictEqual ( err , customError ) ;
195194 t . ok ( opts . custom ) ;
196195 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
197- t . false ( opts . custom . internals ) ;
198- t . ok ( typeof opts . custom . data === 'string' ) ;
196+ t . strictEqual ( opts . custom . data , undefined ) ;
199197 } ;
200198
201199 var server = makeServer ( ) ;
@@ -213,7 +211,7 @@ test('connectionless server error logging with Object', function (t) {
213211 return ;
214212 }
215213
216- t . plan ( 6 ) ;
214+ t . plan ( 5 ) ;
217215
218216 var customError = {
219217 error : 'I forgot to turn this into an actual Error' ,
@@ -224,10 +222,9 @@ test('connectionless server error logging with Object', function (t) {
224222 agent . captureError = function ( err , opts ) {
225223 server . stop ( noop ) ;
226224
227- t . strictEqual ( err , 'hapi server emitted a log event tagged error' ) ;
225+ t . strictEqual ( err , 'hapi server emitted a " log" event tagged " error" ' ) ;
228226 t . ok ( opts . custom ) ;
229227 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
230- t . false ( opts . custom . internals ) ;
231228 t . deepEqual ( opts . custom . data , customError ) ;
232229 } ;
233230
@@ -240,7 +237,7 @@ test('connectionless server error logging with Object', function (t) {
240237} ) ;
241238
242239test ( 'server error logging with Error' , function ( t ) {
243- t . plan ( 6 ) ;
240+ t . plan ( 5 ) ;
244241
245242 var customError = new Error ( 'custom error' ) ;
246243
@@ -252,8 +249,7 @@ test('server error logging with Error', function (t) {
252249 t . strictEqual ( err , customError ) ;
253250 t . ok ( opts . custom ) ;
254251 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
255- t . false ( opts . custom . internals ) ;
256- t . ok ( opts . custom . data instanceof Error ) ;
252+ t . strictEqual ( opts . custom . data , undefined ) ;
257253 } ;
258254
259255 var server = startServer ( function ( err ) {
@@ -264,7 +260,7 @@ test('server error logging with Error', function (t) {
264260} ) ;
265261
266262test ( 'server error logging with Error does not affect event tags' , function ( t ) {
267- t . plan ( 8 ) ;
263+ t . plan ( 7 ) ;
268264
269265 var customError = new Error ( 'custom error' ) ;
270266
@@ -276,8 +272,7 @@ test('server error logging with Error does not affect event tags', function (t)
276272 t . strictEqual ( err , customError ) ;
277273 t . ok ( opts . custom ) ;
278274 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
279- t . false ( opts . custom . internals ) ;
280- t . ok ( opts . custom . data instanceof Error ) ;
275+ t . strictEqual ( opts . custom . data , undefined ) ;
281276 } ;
282277
283278 var server = makeServer ( ) ;
@@ -299,7 +294,7 @@ test('server error logging with Error does not affect event tags', function (t)
299294} ) ;
300295
301296test ( 'server error logging with String' , function ( t ) {
302- t . plan ( 6 ) ;
297+ t . plan ( 5 ) ;
303298
304299 var customError = 'custom error' ;
305300
@@ -311,8 +306,7 @@ test('server error logging with String', function (t) {
311306 t . strictEqual ( err , customError ) ;
312307 t . ok ( opts . custom ) ;
313308 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
314- t . false ( opts . custom . internals ) ;
315- t . ok ( typeof opts . custom . data === 'string' ) ;
309+ t . strictEqual ( opts . custom . data , undefined ) ;
316310 } ;
317311
318312 var server = startServer ( function ( err ) {
@@ -323,7 +317,7 @@ test('server error logging with String', function (t) {
323317} ) ;
324318
325319test ( 'server error logging with Object' , function ( t ) {
326- t . plan ( 6 ) ;
320+ t . plan ( 5 ) ;
327321
328322 var customError = {
329323 error : 'I forgot to turn this into an actual Error' ,
@@ -334,10 +328,9 @@ test('server error logging with Object', function (t) {
334328 agent . captureError = function ( err , opts ) {
335329 server . stop ( noop ) ;
336330
337- t . strictEqual ( err , 'hapi server emitted a log event tagged error' ) ;
331+ t . strictEqual ( err , 'hapi server emitted a " log" event tagged " error" ' ) ;
338332 t . ok ( opts . custom ) ;
339333 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
340- t . false ( opts . custom . internals ) ;
341334 t . deepEqual ( opts . custom . data , customError ) ;
342335 } ;
343336
@@ -349,7 +342,7 @@ test('server error logging with Object', function (t) {
349342} ) ;
350343
351344test ( 'request error logging with Error' , function ( t ) {
352- t . plan ( 13 ) ;
345+ t . plan ( 12 ) ;
353346
354347 var customError = new Error ( 'custom error' ) ;
355348
@@ -364,8 +357,7 @@ test('request error logging with Error', function (t) {
364357 t . ok ( opts . custom ) ;
365358 t . ok ( opts . request ) ;
366359 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
367- t . false ( opts . custom . internals ) ;
368- t . ok ( opts . custom . data instanceof Error ) ;
360+ t . strictEqual ( opts . custom . data , undefined ) ;
369361 } ;
370362
371363 var server = makeServer ( ) ;
@@ -394,7 +386,7 @@ test('request error logging with Error', function (t) {
394386} ) ;
395387
396388test ( 'request error logging with Error does not affect event tags' , function ( t ) {
397- t . plan ( 15 ) ;
389+ t . plan ( 14 ) ;
398390
399391 var customError = new Error ( 'custom error' ) ;
400392
@@ -409,8 +401,7 @@ test('request error logging with Error does not affect event tags', function (t)
409401 t . ok ( opts . custom ) ;
410402 t . ok ( opts . request ) ;
411403 t . deepEqual ( opts . custom . tags , [ 'elastic-apm' , 'error' ] ) ;
412- t . false ( opts . custom . internals ) ;
413- t . ok ( opts . custom . data instanceof Error ) ;
404+ t . strictEqual ( opts . custom . data , undefined ) ;
414405 } ;
415406
416407 var server = makeServer ( ) ;
@@ -450,7 +441,7 @@ test('request error logging with Error does not affect event tags', function (t)
450441} ) ;
451442
452443test ( 'request error logging with String' , function ( t ) {
453- t . plan ( 13 ) ;
444+ t . plan ( 12 ) ;
454445
455446 var customError = 'custom error' ;
456447
@@ -465,8 +456,7 @@ test('request error logging with String', function (t) {
465456 t . ok ( opts . custom ) ;
466457 t . ok ( opts . request ) ;
467458 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
468- t . false ( opts . custom . internals ) ;
469- t . ok ( typeof opts . custom . data === 'string' ) ;
459+ t . strictEqual ( opts . custom . data , undefined ) ;
470460 } ;
471461
472462 var server = makeServer ( ) ;
@@ -495,7 +485,7 @@ test('request error logging with String', function (t) {
495485} ) ;
496486
497487test ( 'request error logging with Object' , function ( t ) {
498- t . plan ( 13 ) ;
488+ t . plan ( 12 ) ;
499489
500490 var customError = {
501491 error : 'I forgot to turn this into an actual Error' ,
@@ -508,11 +498,10 @@ test('request error logging with Object', function (t) {
508498 } ) ;
509499
510500 agent . captureError = function ( err , opts ) {
511- t . strictEqual ( err , 'hapi server emitted a request event tagged error' ) ;
501+ t . strictEqual ( err , 'hapi server emitted a " request" event tagged " error" ' ) ;
512502 t . ok ( opts . custom ) ;
513503 t . ok ( opts . request ) ;
514504 t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
515- t . false ( opts . custom . internals ) ;
516505 t . deepEqual ( opts . custom . data , customError ) ;
517506 } ;
518507
0 commit comments