Skip to content

Commit 05b3797

Browse files
add check taht stub is called
1 parent effcbd4 commit 05b3797

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ describe('Handshake Prose Tests', function () {
111111
}
112112

113113
context(`Test 2: Test that the driver accepts an arbitrary auth mechanism`, function () {
114+
let stubCalled = false;
114115
beforeEach(() => {
115116
// Mock the server response in a way that saslSupportedMechs array in the hello command response contains an arbitrary string.
116117
sinon.stub(Connection.prototype, 'command').callsFake(async function (ns, cmd, options) {
@@ -122,6 +123,7 @@ describe('Handshake Prose Tests', function () {
122123
return command(ns, cmd, options);
123124

124125
async function stub() {
126+
stubCalled = true;
125127
const response = await command(ns, cmd, options);
126128
return {
127129
...response,
@@ -139,6 +141,8 @@ describe('Handshake Prose Tests', function () {
139141
client = this.configuration.newClient();
140142
await client.connect();
141143
await client.db('foo').collection('bar').insertOne({ name: 'john doe' });
144+
145+
expect(stubCalled).to.be.true;
142146
await client.close();
143147
});
144148
});

0 commit comments

Comments
 (0)