Skip to content

Commit

Permalink
test: add test for no wire version provided
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Nov 2, 2021
1 parent 1c3defe commit ec58e76
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unit/sdam/server_selection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,22 @@ describe('ServerSelector', function () {
});
});
});

context('when a common wire version is not provided', function () {
const topologyDescription = new TopologyDescription(
TopologyType.ReplicaSetWithPrimary,
serverDescriptions,
'test',
MIN_SECONDARY_WRITE_WIRE_VERSION,
new ObjectId(),
MIN_SECONDARY_WRITE_WIRE_VERSION
);
const selector = secondaryWritableServerSelector();
const server = selector(topologyDescription, Array.from(serverDescriptions.values()));

it('selects a primary', function () {
expect(server).to.deep.equal([primary]);
});
});
});
});

0 comments on commit ec58e76

Please sign in to comment.