File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
dev-packages/browser-integration-tests/suites/public-api/captureException Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1+ Sentry . captureException ( new Response ( 'test body' ) ) ;
Original file line number Diff line number Diff line change 1+ import { expect } from '@playwright/test' ;
2+ import type { Event } from '@sentry/core' ;
3+ import { sentryTest } from '../../../../utils/fixtures' ;
4+ import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers' ;
5+
6+ sentryTest ( 'should capture a class instance of a built-in class' , async ( { getLocalTestUrl, page } ) => {
7+ const url = await getLocalTestUrl ( { testDir : __dirname } ) ;
8+
9+ const eventData = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
10+
11+ expect ( eventData . exception ?. values ) . toHaveLength ( 1 ) ;
12+ expect ( eventData . exception ?. values ?. [ 0 ] ) . toMatchObject ( {
13+ type : 'Error' ,
14+ value : '[object Response]' ,
15+ mechanism : {
16+ type : 'generic' ,
17+ handled : true ,
18+ } ,
19+ } ) ;
20+ } ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { Event } from '@sentry/core';
33import { sentryTest } from '../../../../utils/fixtures' ;
44import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers' ;
55
6- sentryTest ( 'should capture an POJO ' , async ( { getLocalTestUrl, page } ) => {
6+ sentryTest ( 'should capture an class instance ' , async ( { getLocalTestUrl, page } ) => {
77 const url = await getLocalTestUrl ( { testDir : __dirname } ) ;
88
99 const eventData = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
You can’t perform that action at this time.
0 commit comments