@@ -3,6 +3,8 @@ import { expect } from 'chai';
33import Rollbar from '../src/browser/rollbar.js' ;
44import * as t from '../src/browser/transforms.js' ;
55
6+ import { Cause } from './browser.rollbar.test-utils.ts' ;
7+
68function TestClientGen ( ) {
79 const TestClient = function ( ) {
810 this . notifier = {
@@ -438,7 +440,7 @@ describe('addBody', function () {
438440 describe ( 'with nested error' , function ( ) {
439441 it ( 'should create trace_chain' , function ( done ) {
440442 const nestedErr = new Error ( 'nested error' ) ;
441- const err = new Error ( 'test error' ) as Error & { nested ?: Error } ;
443+ const err = new Error ( 'test error' ) as Rollbar . ErrorWithContext ;
442444 err . nested = nestedErr ;
443445 const args = [ 'a message' , err ] ;
444446 const item = itemFromArgs ( args ) ;
@@ -458,14 +460,9 @@ describe('addBody', function () {
458460 } ) ;
459461 } ) ;
460462 it ( 'should create add error context as custom data' , function ( done ) {
461- const nestedErr = new Error ( 'nested error' ) as Error & {
462- rollbarContext ?: any ;
463- } ;
463+ const nestedErr = new Error ( 'nested error' ) as Rollbar . ErrorWithContext ;
464464 nestedErr . rollbarContext = { err1 : 'nested context' } ;
465- const err = new Error ( 'test error' ) as Error & {
466- rollbarContext ?: any ;
467- nested ?: Error ;
468- } ;
465+ const err = new Error ( 'test error' ) as Rollbar . ErrorWithContext ;
469466 err . rollbarContext = { err2 : 'error context' } ;
470467 err . nested = nestedErr ;
471468 const args = [ 'a message' , err ] ;
@@ -488,7 +485,7 @@ describe('addBody', function () {
488485
489486 it ( 'should create trace_chain' , function ( done ) {
490487 const causeErr = new Error ( 'cause error' ) ;
491- const err = new Error ( 'test error' ) as Error & { cause ?: Error } ;
488+ const err = new Error ( 'test error' ) as Error & Cause ;
492489 err . cause = causeErr ;
493490 const args = [ 'a message' , err ] ;
494491 const item = itemFromArgs ( args ) ;
@@ -508,14 +505,9 @@ describe('addBody', function () {
508505 } ) ;
509506 } ) ;
510507 it ( 'should create add error context as custom data' , function ( done ) {
511- const causeErr = new Error ( 'cause error' ) as Error & {
512- rollbarContext ?: any ;
513- } ;
508+ const causeErr = new Error ( 'cause error' ) as Rollbar . ErrorWithContext ;
514509 causeErr . rollbarContext = { err1 : 'cause context' } ;
515- const err = new Error ( 'test error' ) as Error & {
516- rollbarContext ?: any ;
517- cause ?: Error ;
518- } ;
510+ const err = new Error ( 'test error' ) as Rollbar . ErrorWithContext & Cause ;
519511 err . cause = causeErr ;
520512 err . rollbarContext = { err2 : 'error context' } ;
521513 const args = [ 'a message' , err ] ;
0 commit comments