Skip to content

Commit 693984b

Browse files
committed
What happens when events stream errors?
1 parent efc79e0 commit 693984b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/socket/src/streamingsocket.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ const enabled = !!globalThis.process?.env.SOCKETSERVER_ENABLED;
6868
subscription.unsubscribe();
6969
done();
7070
},
71+
error: (err) => {
72+
// err is an ErrorEvent but we don't get types for that
73+
done.fail(
74+
`Unexpected error in events stream: "${err.message}" / "${err.toString()}" / code=${err.code} / JSON=${JSON.stringify(err)} (${err})`,
75+
);
76+
},
7177
});
7278

7379
(async () => {

0 commit comments

Comments
 (0)