Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/relay-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2032,14 +2032,16 @@ describe("RelayServer", () => {
await waitForHandshakeAck(extension);

ops.send(JSON.stringify({ type: "ops_hello", version: "1", maxPayloadBytes: 1024 }));
const opsErrorPromise = nextMessageWithTimeout(ops, 1000);
const opsClosePromise = waitForClose(ops);
const forwardedHello = await nextMessage(extension);
expect(forwardedHello.type).toBe("ops_hello");

const statusResponse = await fetch(`http://127.0.0.1:${started.port}/status`);
const statusData = await statusResponse.json();
expect(statusData.opsConnected).toBe(false);

const response = await nextMessageWithTimeout(ops, 1000);
const response = await opsErrorPromise;
expect(response).toMatchObject({
type: "ops_error",
requestId: "ops_hello",
Expand All @@ -2049,7 +2051,7 @@ describe("RelayServer", () => {
}
});
expect((response.error as { details?: { reason?: string } }).details?.reason).toBe("ops_hello_timeout");
expect(await waitForClose(ops)).toBe(1011);
expect(await opsClosePromise).toBe(1011);
expect(server.status().opsConnected).toBe(false);

extension.close();
Expand Down
Loading