@@ -257,8 +257,10 @@ describe('BaseClient', () => {
257257 [ '`Error` instance' , new Error ( 'Will I get caught twice?' ) ] ,
258258 [ 'plain object' , { 'Will I' : 'get caught twice?' } ] ,
259259 [ 'primitive wrapper' , new String ( 'Will I get caught twice?' ) ] ,
260- // primitives aren't tested directly here because they need to be wrapped with `objectify` *before* being passed
261- // to `captureException` (which is how we'd end up with a primitive wrapper as tested above)
260+ // Primitives aren't tested directly here because they need to be wrapped with `objectify` *before* being passed
261+ // to `captureException` (which is how we'd end up with a primitive wrapper as tested above) in order for the
262+ // already-seen check to work . Any primitive which is passed without being wrapped will be captured each time it
263+ // is encountered, so this test doesn't apply.
262264 ] ) ( "doesn't capture the same exception twice - %s" , ( _name : string , thrown : any ) => {
263265 const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
264266
@@ -354,9 +356,14 @@ describe('BaseClient', () => {
354356 [ '`Error` instance' , new Error ( 'Will I get caught twice?' ) ] ,
355357 [ 'plain object' , { 'Will I' : 'get caught twice?' } ] ,
356358 [ 'primitive wrapper' , new String ( 'Will I get caught twice?' ) ] ,
357- // primitives aren't tested directly here because they need to be wrapped with `objectify` *before* being passed
358- // to `captureEvent` (which is how we'd end up with a primitive wrapper as tested above)
359+ // Primitives aren't tested directly here because they need to be wrapped with `objectify` *before* being passed
360+ // to `captureEvent` (which is how we'd end up with a primitive wrapper as tested above) in order for the
361+ // already-seen check to work . Any primitive which is passed without being wrapped will be captured each time it
362+ // is encountered, so this test doesn't apply.
359363 ] ) ( "doesn't capture the same exception twice - %s" , ( _name : string , thrown : any ) => {
364+ // Note: this is the same test as in `describe(captureException)`, except with the exception already wrapped in a
365+ // hint and accompanying an event. Duplicated here because some methods skip `captureException` and go straight to
366+ // `captureEvent`.
360367 const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
361368 const event = { exception : { values : [ { type : 'Error' , message : 'Will I get caught twice?' } ] } } ;
362369 const hint = { originalException : thrown } ;
0 commit comments