File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
packages/integrations/test Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ describe('ExtraErrorData()', () => {
114114 } ) ;
115115 } ) ;
116116
117- it ( 'toJSON props should have prioroty over directly assigned ones' , ( ) => {
117+ it ( 'toJSON props should have priority over directly assigned ones' , ( ) => {
118118 const error = new TypeError ( 'foo' ) as ExtendedError ;
119119 error . baz = 42 ;
120120 error . toJSON = function ( ) {
@@ -133,4 +133,25 @@ describe('ExtraErrorData()', () => {
133133 } ,
134134 } ) ;
135135 } ) ;
136+
137+ it ( 'toJSON props should allow for usage of native names' , ( ) => {
138+ const error = new TypeError ( 'foo' ) as ExtendedError ;
139+ error . baz = 42 ;
140+ error . toJSON = function ( ) {
141+ return {
142+ message : 'bar' ,
143+ } ;
144+ } ;
145+
146+ const enhancedEvent = extraErrorData . enhanceEventWithErrorData ( event , {
147+ originalException : error ,
148+ } ) ;
149+
150+ expect ( enhancedEvent . contexts ) . toEqual ( {
151+ TypeError : {
152+ baz : 42 ,
153+ message : 'bar' ,
154+ } ,
155+ } ) ;
156+ } ) ;
136157} ) ;
You can’t perform that action at this time.
0 commit comments