Skip to content

Commit 33d8a2f

Browse files
committed
chore: 🤖 revert back test setup
1 parent 258d03a commit 33d8a2f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/__tests__/e2e/clients.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import {FetchRpcClient} from '../../common/rpc/client/FetchRpcClient';
22
import {StreamingRpcClient} from '../../common';
3-
import {createClient} from '../../browser/createClient';
3+
import WebSocket from 'ws';
4+
import {RpcPersistentClient, WebSocketChannel} from '../../common';
45
import type {RpcCodec} from '../../common/codec/RpcCodec';
56

67
export const setupRpcPersistentClient = (codec: RpcCodec) => {
78
const port = +(process.env.PORT || 9999);
89
const url = `ws://localhost:${port}/rx`;
9-
const client = createClient(codec, url);
10+
const client = new RpcPersistentClient({
11+
codec,
12+
channel: {
13+
newChannel: () =>
14+
new WebSocketChannel({
15+
newSocket: () => new WebSocket(url, [codec.specifier()]) as any,
16+
}),
17+
},
18+
});
19+
client.start();
1020
const call = client.call.bind(client);
1121
const call$ = client.call$.bind(client);
1222
const stop = async () => void client.stop();

0 commit comments

Comments
 (0)