Skip to content

Commit 362d401

Browse files
committed
adjust tests a bit further
1 parent 3e10df6 commit 362d401

File tree

1 file changed

+4
-2
lines changed
  • dev-packages/e2e-tests/test-applications/cloudflare-workers/tests

1 file changed

+4
-2
lines changed

dev-packages/e2e-tests/test-applications/cloudflare-workers/tests/index.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test("Request processed by DurableObject's fetch is recorded", async ({ baseURL
4040

4141
test('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

5657
test('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

Comments
 (0)