Skip to content

Commit 9690249

Browse files
committed
refactor: lift is4_2 method to global
1 parent c7f5599 commit 9690249

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/integration/change-streams/change_stream.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ const initIteratorMode = async (cs: ChangeStream) => {
4141
return;
4242
};
4343

44+
const is4_2Server = (serverVersion: string) =>
45+
gte(serverVersion, '4.2.0') && lt(serverVersion, '4.3.0');
46+
4447
// Define the pipeline processing changes
4548
const pipeline = [
4649
{ $addFields: { addedField: 'This is a field added using $addFields' } },
@@ -54,9 +57,6 @@ describe('Change Streams', function () {
5457
let changeStream: ChangeStream;
5558
let db: Db;
5659

57-
const is4_2Server = (serverVersion: string) =>
58-
gte(serverVersion, '4.2.0') && lt(serverVersion, '4.3.0');
59-
6060
beforeEach(async function () {
6161
const configuration = this.configuration;
6262
client = configuration.newClient();
@@ -1791,9 +1791,6 @@ describe('ChangeStream resumability', function () {
17911791
{ error: 'CursorNotFound', code: 43, message: 'cursor not found' }
17921792
];
17931793

1794-
const is4_2Server = (serverVersion: string) =>
1795-
gte(serverVersion, '4.2.0') && lt(serverVersion, '4.3.0');
1796-
17971794
beforeEach(function () {
17981795
assert(this.currentTest != null);
17991796
if (

0 commit comments

Comments
 (0)