@@ -7,20 +7,20 @@ const chai = require('chai');
7
7
const expect = chai . expect ;
8
8
chai . use ( require ( 'chai-subset' ) ) ;
9
9
10
+ const metadata = {
11
+ requires : {
12
+ mongodb : '>=4.2.0' ,
13
+ clientSideEncryption : true
14
+ }
15
+ } ;
16
+
10
17
describe ( 'Client Side Encryption Functional' , function ( ) {
11
18
const dataDbName = 'db' ;
12
19
const dataCollName = 'coll' ;
13
20
const keyVaultDbName = 'keyvault' ;
14
21
const keyVaultCollName = 'datakeys' ;
15
22
const keyVaultNamespace = `${ keyVaultDbName } .${ keyVaultCollName } ` ;
16
23
17
- const metadata = {
18
- requires : {
19
- mongodb : '>=4.2.0' ,
20
- clientSideEncryption : true
21
- }
22
- } ;
23
-
24
24
it ( 'CSFLE_KMS_PROVIDERS should be valid EJSON' , function ( ) {
25
25
if ( process . env . CSFLE_KMS_PROVIDERS ) {
26
26
/**
@@ -228,6 +228,9 @@ describe('Client Side Encryption Functional', function () {
228
228
let collection ;
229
229
230
230
beforeEach ( async function ( ) {
231
+ if ( this . configuration . clientSideEncryption == null ) {
232
+ return ;
233
+ }
231
234
const encryptionOptions = {
232
235
monitorCommands : true ,
233
236
autoEncryption : {
@@ -244,7 +247,7 @@ describe('Client Side Encryption Functional', function () {
244
247
} ) ;
245
248
246
249
describe ( 'find' , ( ) => {
247
- it ( 'should maintain ordered sort' , async function ( ) {
250
+ it ( 'should maintain ordered sort' , metadata , async function ( ) {
248
251
const events = [ ] ;
249
252
client . on ( 'commandStarted' , ev => events . push ( ev ) ) ;
250
253
const sort = new Map ( [
@@ -259,7 +262,7 @@ describe('Client Side Encryption Functional', function () {
259
262
} ) ;
260
263
261
264
describe ( 'findAndModify' , ( ) => {
262
- it ( 'should maintain ordered sort' , async function ( ) {
265
+ it ( 'should maintain ordered sort' , metadata , async function ( ) {
263
266
const events = [ ] ;
264
267
client . on ( 'commandStarted' , ev => events . push ( ev ) ) ;
265
268
const sort = new Map ( [
@@ -274,7 +277,7 @@ describe('Client Side Encryption Functional', function () {
274
277
} ) ;
275
278
276
279
describe ( 'createIndexes' , ( ) => {
277
- it ( 'should maintain ordered index keys' , async function ( ) {
280
+ it ( 'should maintain ordered index keys' , metadata , async function ( ) {
278
281
const events = [ ] ;
279
282
client . on ( 'commandStarted' , ev => events . push ( ev ) ) ;
280
283
const indexDescription = new Map ( [
0 commit comments