Skip to content

Commit 60ad9ac

Browse files
fix logic
1 parent ad5b150 commit 60ad9ac

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

test/integration/retryable-writes/retryable_writes.spec.test.ts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ describe('Legacy Retryable Writes Specs', function () {
5757

5858
await utilClient.close();
5959

60-
if (
61-
this.configuration.topologyType === 'Sharded' &&
62-
lt(this.configuration.version, '4.4.0')
63-
) {
64-
// 'TODO(NODE-5925): will be resolved when driver migrates to unified tests
65-
this.skip();
66-
}
67-
6860
if (!someRequirementMet) this.skip();
6961
});
7062

@@ -73,6 +65,15 @@ describe('Legacy Retryable Writes Specs', function () {
7365
// like creating a client, dropping and refilling data collections,
7466
// and enabling failpoints
7567
const { spec } = this.currentTest;
68+
if (
69+
this.configuration.topologyType === 'Sharded' &&
70+
lt(this.configuration.version, '4.4.0') &&
71+
LEGACY_SKIP_TESTS_4_4_SHARDED.includes(spec.description)
72+
) {
73+
this.currentTest.skipReason =
74+
'TODO(NODE-5925): will be resolved when driver migrates to unified tests';
75+
this.skip();
76+
}
7677
await executeScenarioSetup(suite, spec, this.configuration, ctx);
7778
});
7879

@@ -89,16 +90,14 @@ describe('Legacy Retryable Writes Specs', function () {
8990
ctx = {}; // reset context
9091
});
9192
for (const spec of suite.tests) {
92-
if (!LEGACY_SKIP_TESTS_4_4_SHARDED.includes(spec.description)) {
93-
// Step 2: Run the test
94-
const mochaTest = it(spec.description, async () => await executeScenarioTest(spec, ctx));
95-
96-
// A pattern we don't need to repeat for unified tests
97-
// In order to give the beforeEach hook access to the
98-
// spec test so it can be responsible for skipping it
99-
// and executeScenarioSetup
100-
mochaTest.spec = spec;
101-
}
93+
// Step 2: Run the test
94+
const mochaTest = it(spec.description, async () => await executeScenarioTest(spec, ctx));
95+
96+
// A pattern we don't need to repeat for unified tests
97+
// In order to give the beforeEach hook access to the
98+
// spec test so it can be responsible for skipping it
99+
// and executeScenarioSetup
100+
mochaTest.spec = spec;
102101
}
103102
});
104103
}

0 commit comments

Comments
 (0)