Skip to content

Commit

Permalink
test: more snapshot session cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dariakp committed Dec 1, 2022
1 parent ae03f39 commit e8dac05
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/unit/sessions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,23 @@ describe('Sessions - unit', function () {
expect(session.supports).property('causalConsistency', true);
});

it('should default `causalConsistency` to `false` for explicit snapshot sessions', function () {
const session = new ClientSession(client, serverSessionPool, {
explicit: true,
snapshot: true
});
expect(session.supports).property('causalConsistency', false);
});

it('should allow `causalConsistency=false` option in explicit snapshot sessions', function () {
const session = new ClientSession(client, serverSessionPool, {
explicit: true,
causalConsistency: false,
snapshot: true
});
expect(session.supports).property('causalConsistency', false);
});

it('should respect `causalConsistency=false` option in explicit sessions', function () {
const session = new ClientSession(client, serverSessionPool, {
explicit: true,
Expand All @@ -180,7 +197,7 @@ describe('Sessions - unit', function () {
expect(session.supports).property('causalConsistency', false);
});

it('should respect `causalConsistency=true` option in explicit sessions', function () {
it('should respect `causalConsistency=true` option in explicit non-snapshot sessions', function () {
const session = new ClientSession(client, serverSessionPool, {
explicit: true,
causalConsistency: true
Expand Down

0 comments on commit e8dac05

Please sign in to comment.