@@ -40,7 +40,7 @@ test("Request processed by DurableObject's fetch is recorded", async ({ baseURL
4040
4141test ( 'Websocket.webSocketMessage' , async ( { baseURL } ) => {
4242 const eventWaiter = waitForError ( 'cloudflare-workers' , event => {
43- return event . exception ?. values ?. [ 0 ] ?. mechanism ?. type === 'auto.faas.cloudflare.durable_object' ;
43+ return ! ! event . exception ?. values ?. [ 0 ] ;
4444 } ) ;
4545 const url = new URL ( '/pass-to-object/ws' , baseURL ) ;
4646 url . protocol = url . protocol . replace ( 'http' , 'ws' ) ;
@@ -51,11 +51,12 @@ test('Websocket.webSocketMessage', async ({ baseURL }) => {
5151 const event = await eventWaiter ;
5252 socket . close ( ) ;
5353 expect ( event . exception ?. values ?. [ 0 ] ?. value ) . toBe ( 'Should be recorded in Sentry: webSocketMessage' ) ;
54+ expect ( event . exception ?. values ?. [ 0 ] ?. mechanism ?. type ) . toBe ( 'auto.faas.cloudflare.durable_object' ) ;
5455} ) ;
5556
5657test ( 'Websocket.webSocketClose' , async ( { baseURL } ) => {
5758 const eventWaiter = waitForError ( 'cloudflare-workers' , event => {
58- return event . exception ?. values ?. [ 0 ] ?. mechanism ?. type === 'auto.faas.cloudflare.durable_object' ;
59+ return ! ! event . exception ?. values ?. [ 0 ] ;
5960 } ) ;
6061 const url = new URL ( '/pass-to-object/ws' , baseURL ) ;
6162 url . protocol = url . protocol . replace ( 'http' , 'ws' ) ;
@@ -66,4 +67,5 @@ test('Websocket.webSocketClose', async ({ baseURL }) => {
6667 } ) ;
6768 const event = await eventWaiter ;
6869 expect ( event . exception ?. values ?. [ 0 ] ?. value ) . toBe ( 'Should be recorded in Sentry: webSocketClose' ) ;
70+ expect ( event . exception ?. values ?. [ 0 ] ?. mechanism ?. type ) . toBe ( 'auto.faas.cloudflare.durable_object' ) ;
6971} ) ;
0 commit comments