Skip to content

Commit 6b0484b

Browse files
committed
test: skip transactions on sharded clusters for MongoDB versions < 4.2
1 parent 35dc341 commit 6b0484b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/integration/transactions/transactions.prose.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expect } from 'chai';
2+
import * as semver from 'semver';
23

34
import { type MongoClient } from '../../mongodb';
45

@@ -13,6 +14,16 @@ describe('Transactions Spec Prose', function () {
1314
const started = [];
1415

1516
beforeEach(async function () {
17+
if (
18+
semver.satisfies(this.configuration.version, '>4.2') &&
19+
this.configuration.topologyType === 'Sharded'
20+
) {
21+
if (this.currentTest) {
22+
this.currentTest.skipReason =
23+
'Transactions on sharded clusters are only supported after 4.2';
24+
}
25+
this.skip();
26+
}
1627
started.length = 0;
1728
client = this.configuration.newClient({}, { monitorCommands: true });
1829

0 commit comments

Comments
 (0)