@@ -151,7 +151,7 @@ test('connectionless server error logging with Error', function (t) {
151
151
return ;
152
152
}
153
153
154
- t . plan ( 6 ) ;
154
+ t . plan ( 5 ) ;
155
155
156
156
var customError = new Error ( 'custom error' ) ;
157
157
@@ -163,8 +163,7 @@ test('connectionless server error logging with Error', function (t) {
163
163
t . strictEqual ( err , customError ) ;
164
164
t . ok ( opts . custom ) ;
165
165
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 ) ;
168
167
} ;
169
168
170
169
var server = makeServer ( ) ;
@@ -182,7 +181,7 @@ test('connectionless server error logging with String', function (t) {
182
181
return ;
183
182
}
184
183
185
- t . plan ( 6 ) ;
184
+ t . plan ( 5 ) ;
186
185
187
186
var customError = 'custom error' ;
188
187
@@ -194,8 +193,7 @@ test('connectionless server error logging with String', function (t) {
194
193
t . strictEqual ( err , customError ) ;
195
194
t . ok ( opts . custom ) ;
196
195
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 ) ;
199
197
} ;
200
198
201
199
var server = makeServer ( ) ;
@@ -213,7 +211,7 @@ test('connectionless server error logging with Object', function (t) {
213
211
return ;
214
212
}
215
213
216
- t . plan ( 6 ) ;
214
+ t . plan ( 5 ) ;
217
215
218
216
var customError = {
219
217
error : 'I forgot to turn this into an actual Error' ,
@@ -224,10 +222,9 @@ test('connectionless server error logging with Object', function (t) {
224
222
agent . captureError = function ( err , opts ) {
225
223
server . stop ( noop ) ;
226
224
227
- t . strictEqual ( err , 'hapi server emitted a log event tagged error' ) ;
225
+ t . strictEqual ( err , 'hapi server emitted a " log" event tagged " error" ' ) ;
228
226
t . ok ( opts . custom ) ;
229
227
t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
230
- t . false ( opts . custom . internals ) ;
231
228
t . deepEqual ( opts . custom . data , customError ) ;
232
229
} ;
233
230
@@ -240,7 +237,7 @@ test('connectionless server error logging with Object', function (t) {
240
237
} ) ;
241
238
242
239
test ( 'server error logging with Error' , function ( t ) {
243
- t . plan ( 6 ) ;
240
+ t . plan ( 5 ) ;
244
241
245
242
var customError = new Error ( 'custom error' ) ;
246
243
@@ -252,8 +249,7 @@ test('server error logging with Error', function (t) {
252
249
t . strictEqual ( err , customError ) ;
253
250
t . ok ( opts . custom ) ;
254
251
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 ) ;
257
253
} ;
258
254
259
255
var server = startServer ( function ( err ) {
@@ -264,7 +260,7 @@ test('server error logging with Error', function (t) {
264
260
} ) ;
265
261
266
262
test ( 'server error logging with Error does not affect event tags' , function ( t ) {
267
- t . plan ( 8 ) ;
263
+ t . plan ( 7 ) ;
268
264
269
265
var customError = new Error ( 'custom error' ) ;
270
266
@@ -276,8 +272,7 @@ test('server error logging with Error does not affect event tags', function (t)
276
272
t . strictEqual ( err , customError ) ;
277
273
t . ok ( opts . custom ) ;
278
274
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 ) ;
281
276
} ;
282
277
283
278
var server = makeServer ( ) ;
@@ -299,7 +294,7 @@ test('server error logging with Error does not affect event tags', function (t)
299
294
} ) ;
300
295
301
296
test ( 'server error logging with String' , function ( t ) {
302
- t . plan ( 6 ) ;
297
+ t . plan ( 5 ) ;
303
298
304
299
var customError = 'custom error' ;
305
300
@@ -311,8 +306,7 @@ test('server error logging with String', function (t) {
311
306
t . strictEqual ( err , customError ) ;
312
307
t . ok ( opts . custom ) ;
313
308
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 ) ;
316
310
} ;
317
311
318
312
var server = startServer ( function ( err ) {
@@ -323,7 +317,7 @@ test('server error logging with String', function (t) {
323
317
} ) ;
324
318
325
319
test ( 'server error logging with Object' , function ( t ) {
326
- t . plan ( 6 ) ;
320
+ t . plan ( 5 ) ;
327
321
328
322
var customError = {
329
323
error : 'I forgot to turn this into an actual Error' ,
@@ -334,10 +328,9 @@ test('server error logging with Object', function (t) {
334
328
agent . captureError = function ( err , opts ) {
335
329
server . stop ( noop ) ;
336
330
337
- t . strictEqual ( err , 'hapi server emitted a log event tagged error' ) ;
331
+ t . strictEqual ( err , 'hapi server emitted a " log" event tagged " error" ' ) ;
338
332
t . ok ( opts . custom ) ;
339
333
t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
340
- t . false ( opts . custom . internals ) ;
341
334
t . deepEqual ( opts . custom . data , customError ) ;
342
335
} ;
343
336
@@ -349,7 +342,7 @@ test('server error logging with Object', function (t) {
349
342
} ) ;
350
343
351
344
test ( 'request error logging with Error' , function ( t ) {
352
- t . plan ( 13 ) ;
345
+ t . plan ( 12 ) ;
353
346
354
347
var customError = new Error ( 'custom error' ) ;
355
348
@@ -364,8 +357,7 @@ test('request error logging with Error', function (t) {
364
357
t . ok ( opts . custom ) ;
365
358
t . ok ( opts . request ) ;
366
359
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 ) ;
369
361
} ;
370
362
371
363
var server = makeServer ( ) ;
@@ -394,7 +386,7 @@ test('request error logging with Error', function (t) {
394
386
} ) ;
395
387
396
388
test ( 'request error logging with Error does not affect event tags' , function ( t ) {
397
- t . plan ( 15 ) ;
389
+ t . plan ( 14 ) ;
398
390
399
391
var customError = new Error ( 'custom error' ) ;
400
392
@@ -409,8 +401,7 @@ test('request error logging with Error does not affect event tags', function (t)
409
401
t . ok ( opts . custom ) ;
410
402
t . ok ( opts . request ) ;
411
403
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 ) ;
414
405
} ;
415
406
416
407
var server = makeServer ( ) ;
@@ -450,7 +441,7 @@ test('request error logging with Error does not affect event tags', function (t)
450
441
} ) ;
451
442
452
443
test ( 'request error logging with String' , function ( t ) {
453
- t . plan ( 13 ) ;
444
+ t . plan ( 12 ) ;
454
445
455
446
var customError = 'custom error' ;
456
447
@@ -465,8 +456,7 @@ test('request error logging with String', function (t) {
465
456
t . ok ( opts . custom ) ;
466
457
t . ok ( opts . request ) ;
467
458
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 ) ;
470
460
} ;
471
461
472
462
var server = makeServer ( ) ;
@@ -495,7 +485,7 @@ test('request error logging with String', function (t) {
495
485
} ) ;
496
486
497
487
test ( 'request error logging with Object' , function ( t ) {
498
- t . plan ( 13 ) ;
488
+ t . plan ( 12 ) ;
499
489
500
490
var customError = {
501
491
error : 'I forgot to turn this into an actual Error' ,
@@ -508,11 +498,10 @@ test('request error logging with Object', function (t) {
508
498
} ) ;
509
499
510
500
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" ' ) ;
512
502
t . ok ( opts . custom ) ;
513
503
t . ok ( opts . request ) ;
514
504
t . deepEqual ( opts . custom . tags , [ 'error' ] ) ;
515
- t . false ( opts . custom . internals ) ;
516
505
t . deepEqual ( opts . custom . data , customError ) ;
517
506
} ;
518
507
0 commit comments