Skip to content

Commit 3fb8472

Browse files
committed
started work on a test to cover this
1 parent 0238855 commit 3fb8472

File tree

3 files changed

+916
-14
lines changed

3 files changed

+916
-14
lines changed

src/inMemory.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { JSONRPCMessage } from "./types.js";
77
export class InMemoryTransport implements Transport {
88
private _otherTransport?: InMemoryTransport;
99
private _messageQueue: JSONRPCMessage[] = [];
10+
_messageBuffer: JSONRPCMessage[] = [];
1011

1112
onclose?: () => void;
1213
onerror?: (error: Error) => void;
13-
onmessage?: (message: JSONRPCMessage) => void;
1414
sessionId?: string;
1515

1616
/**
@@ -52,4 +52,8 @@ export class InMemoryTransport implements Transport {
5252
this._otherTransport._messageQueue.push(message);
5353
}
5454
}
55+
56+
onmessage(message: JSONRPCMessage) {
57+
this._messageBuffer.push(message)
58+
}
5559
}

0 commit comments

Comments
 (0)