Skip to content

Commit 0a8f547

Browse files
committed
test: add test for availability being 1 when done is false
Signed-off-by: Kevin Viglucci <[email protected]>
1 parent 6e9a41d commit 0a8f547

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/rsocket-websocket-server/src/__tests__/WebsocketDuplexConnection.spec.ts

+19
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,25 @@ describe("WebsocketDuplexConnection", function () {
199199
});
200200
});
201201

202+
describe("when open", () => {
203+
it("declares availability as 1", () => {
204+
// arrange
205+
const socketStub = mock<Duplex>();
206+
const multiplexerDemultiplexer = mock<
207+
Multiplexer & Demultiplexer & FrameHandler
208+
>();
209+
const frame = mock<Frame>();
210+
const connection = new WebsocketDuplexConnection(
211+
socketStub,
212+
frame,
213+
() => multiplexerDemultiplexer
214+
);
215+
216+
// assert
217+
expect(connection.availability).toEqual(1);
218+
});
219+
});
220+
202221
// describe("send()", () => {
203222
// const setupFrame = {
204223
// type: FrameTypes.SETUP,

0 commit comments

Comments
 (0)