Skip to content

Commit

Permalink
test(client): should report error to sink if server shuts down
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed May 2, 2022
1 parent cb3fbe9 commit 17dcee3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/__tests__/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ it('should supply all valid messages received to onMessage', async () => {
await sub.waitForComplete();
});

it('should report error to sink if server goes away', async () => {
const server = await startTServer();

const client = createClient({
url: server.url,
fetchFn: fetch,
retryAttempts: 0,
});

const sub = tsubscribe(client, {
query: 'subscription { ping }',
});
await server.waitForOperation();

await server.dispose();

await sub.waitForError();
});

describe('single connection mode', () => {
it('should not call complete after subscription error', async () => {
const { url } = await startTServer();
Expand Down

0 comments on commit 17dcee3

Please sign in to comment.