Skip to content

Commit 574dd90

Browse files
committed
use semver to test version fit
1 parent 8886a4a commit 574dd90

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/integration/client-side-encryption/client_side_encryption.prose.27.text_queries.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { join } from 'node:path';
33

44
import { type Binary, type Document, EJSON } from 'bson';
55
import { expect } from 'chai';
6+
import * as semver from 'semver';
67

78
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
89
import { ClientEncryption, type MongoClient, MongoDBCollectionNamespace } from '../../mongodb';
@@ -42,8 +43,11 @@ describe('27. Text Explicit Encryption', function () {
4243

4344
beforeEach(async function () {
4445
utilClient = this.configuration.newClient();
45-
const isServer9OrAbove = this.configuration.version >= '9.0.0';
46+
const isServer9OrAbove = semver.satisfies(this.configuration.version, '>=9.0.0');
4647
const shouldRunPrefixSuffixTests = !isServer9OrAbove;
48+
console.log(
49+
`Running tests for MongoDB version ${this.configuration.version}. Prefix/suffix tests should ${shouldRunPrefixSuffixTests ? '' : 'not'} run.`
50+
);
4751

4852
// Using QE CreateCollection() and Collection.Drop(), drop and create the following collections with majority write concern:
4953
// - db.prefix-suffix using the encryptedFields option set to the contents of encryptedFields-prefix-suffix.json

0 commit comments

Comments
 (0)