@@ -7,20 +7,20 @@ const chai = require('chai');
77const expect = chai . expect ;
88chai . use ( require ( 'chai-subset' ) ) ;
99
10+ const metadata = {
11+ requires : {
12+ mongodb : '>=4.2.0' ,
13+ clientSideEncryption : true
14+ }
15+ } ;
16+
1017describe ( 'Client Side Encryption Functional' , function ( ) {
1118 const dataDbName = 'db' ;
1219 const dataCollName = 'coll' ;
1320 const keyVaultDbName = 'keyvault' ;
1421 const keyVaultCollName = 'datakeys' ;
1522 const keyVaultNamespace = `${ keyVaultDbName } .${ keyVaultCollName } ` ;
1623
17- const metadata = {
18- requires : {
19- mongodb : '>=4.2.0' ,
20- clientSideEncryption : true
21- }
22- } ;
23-
2424 it ( 'CSFLE_KMS_PROVIDERS should be valid EJSON' , function ( ) {
2525 if ( process . env . CSFLE_KMS_PROVIDERS ) {
2626 /**
@@ -228,6 +228,9 @@ describe('Client Side Encryption Functional', function () {
228228 let collection ;
229229
230230 beforeEach ( async function ( ) {
231+ if ( this . configuration . clientSideEncryption == null ) {
232+ return ;
233+ }
231234 const encryptionOptions = {
232235 monitorCommands : true ,
233236 autoEncryption : {
@@ -244,7 +247,7 @@ describe('Client Side Encryption Functional', function () {
244247 } ) ;
245248
246249 describe ( 'find' , ( ) => {
247- it ( 'should maintain ordered sort' , async function ( ) {
250+ it ( 'should maintain ordered sort' , metadata , async function ( ) {
248251 const events = [ ] ;
249252 client . on ( 'commandStarted' , ev => events . push ( ev ) ) ;
250253 const sort = new Map ( [
@@ -259,7 +262,7 @@ describe('Client Side Encryption Functional', function () {
259262 } ) ;
260263
261264 describe ( 'findAndModify' , ( ) => {
262- it ( 'should maintain ordered sort' , async function ( ) {
265+ it ( 'should maintain ordered sort' , metadata , async function ( ) {
263266 const events = [ ] ;
264267 client . on ( 'commandStarted' , ev => events . push ( ev ) ) ;
265268 const sort = new Map ( [
@@ -274,7 +277,7 @@ describe('Client Side Encryption Functional', function () {
274277 } ) ;
275278
276279 describe ( 'createIndexes' , ( ) => {
277- it ( 'should maintain ordered index keys' , async function ( ) {
280+ it ( 'should maintain ordered index keys' , metadata , async function ( ) {
278281 const events = [ ] ;
279282 client . on ( 'commandStarted' , ev => events . push ( ev ) ) ;
280283 const indexDescription = new Map ( [
0 commit comments