Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bangtoven committed Sep 29, 2023
1 parent f721f79 commit 9e261b7
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/wallet-sdk/src/connection/RxWebSocket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ describe('RxWebSocket', () => {
const connectionStateListener = jest.fn();
rxWS.setConnectionStateListener(connectionStateListener);

const client = rxWS.connect();

await client;
await rxWS.connect();
await server.connected;

expect(connectionStateListener).toHaveBeenCalledWith(ConnectionState.CONNECTED);
Expand All @@ -45,8 +43,7 @@ describe('RxWebSocket', () => {
afterEach(() => rxWS.disconnect());

test('@connect throws error when connecting again', async () => {
const client = rxWS.connect();
await client;
await rxWS.connect();

await expect(rxWS.connect()).rejects.toThrow('webSocket object is not null');
});
Expand All @@ -60,8 +57,7 @@ describe('RxWebSocket', () => {
});

test('onclose event throws error', async () => {
const client = rxWS.connect();
await client;
await rxWS.connect();
await server.connected;
server.error();

Expand All @@ -72,8 +68,7 @@ describe('RxWebSocket', () => {
const incomingDataListener = jest.fn();
rxWS.setIncomingDataListener(incomingDataListener);

const client = rxWS.connect();
await client;
await rxWS.connect();
await server.connected;

const message = {
Expand All @@ -89,8 +84,7 @@ describe('RxWebSocket', () => {
const incomingDataListener = jest.fn();
rxWS.setIncomingDataListener(incomingDataListener);

const client = rxWS.connect();
await client;
await rxWS.connect();
await server.connected;

server.send('h');
Expand Down

0 comments on commit 9e261b7

Please sign in to comment.