Skip to content

Commit 27cf336

Browse files
committed
test: update test for multiplexed session
1 parent ba15510 commit 27cf336

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/multiplexed-session.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ describe('MultiplexedSession', () => {
6767
return Object.assign(new Session(DATABASE, name), props, {
6868
create: sandbox.stub().resolves(),
6969
transaction: sandbox.stub().returns(new FakeTransaction()),
70+
getMetadata: sandbox.stub().resolves({multiplexed: true}),
7071
});
7172
};
7273

@@ -80,7 +81,6 @@ describe('MultiplexedSession', () => {
8081
});
8182

8283
beforeEach(() => {
83-
DATABASE.session = createSession;
8484
fakeMuxSession = createSession();
8585
sandbox
8686
.stub(DATABASE, 'createSession')
@@ -195,6 +195,15 @@ describe('MultiplexedSession', () => {
195195
const session = await multiplexedSession._acquire();
196196
assert.strictEqual(session, fakeMuxSession);
197197
});
198+
it('should have the multiplexed property set to true', async () => {
199+
sandbox.stub(multiplexedSession, '_getSession').resolves(fakeMuxSession);
200+
const session = await multiplexedSession._acquire();
201+
assert.strictEqual((await session!.getMetadata()).multiplexed, true);
202+
assert.strictEqual(
203+
(await fakeMuxSession!.getMetadata()).multiplexed,
204+
true
205+
);
206+
});
198207
});
199208

200209
describe('_getSession', () => {

0 commit comments

Comments
 (0)