@@ -19,15 +19,15 @@ describe('MongoCryptConstructor', () => {
19
19
const mc = new MongoCrypt ( {
20
20
kmsProviders : serialize ( { aws : { } } ) ,
21
21
cryptoCallbacks : {
22
- aes256CbcEncryptHook : ( ) => { } ,
23
- aes256CbcDecryptHook : ( ) => { } ,
24
- aes256CtrEncryptHook : ( ) => { } ,
25
- aes256CtrDecryptHook : ( ) => { } ,
22
+ aes256CbcEncryptHook : ( ) => { } ,
23
+ aes256CbcDecryptHook : ( ) => { } ,
24
+ aes256CtrEncryptHook : ( ) => { } ,
25
+ aes256CtrDecryptHook : ( ) => { } ,
26
26
randomHook,
27
- hmacSha512Hook : ( ) => { } ,
28
- hmacSha256Hook : ( ) => { } ,
29
- sha256Hook : ( ) => { } ,
30
- signRsaSha256Hook : ( ) => { }
27
+ hmacSha512Hook : ( ) => { } ,
28
+ hmacSha256Hook : ( ) => { } ,
29
+ sha256Hook : ( ) => { } ,
30
+ signRsaSha256Hook : ( ) => { }
31
31
}
32
32
} ) ;
33
33
@@ -41,17 +41,17 @@ describe('MongoCryptConstructor', () => {
41
41
kmsProviders : serialize ( { aws : { } } ) ,
42
42
schemaMap : serialize ( { } ) ,
43
43
encryptedFieldsMap : serialize ( { } ) ,
44
- logger : ( ) => { } ,
44
+ logger : ( ) => { } ,
45
45
cryptoCallbacks : {
46
- aes256CbcEncryptHook : ( ) => { } ,
47
- aes256CbcDecryptHook : ( ) => { } ,
48
- aes256CtrEncryptHook : ( ) => { } ,
49
- aes256CtrDecryptHook : ( ) => { } ,
46
+ aes256CbcEncryptHook : ( ) => { } ,
47
+ aes256CbcDecryptHook : ( ) => { } ,
48
+ aes256CtrEncryptHook : ( ) => { } ,
49
+ aes256CtrDecryptHook : ( ) => { } ,
50
50
randomHook,
51
- hmacSha512Hook : ( ) => { } ,
52
- hmacSha256Hook : ( ) => { } ,
53
- sha256Hook : ( ) => { } ,
54
- signRsaSha256Hook : ( ) => { }
51
+ hmacSha512Hook : ( ) => { } ,
52
+ hmacSha256Hook : ( ) => { } ,
53
+ sha256Hook : ( ) => { } ,
54
+ signRsaSha256Hook : ( ) => { }
55
55
} ,
56
56
57
57
bypassQueryAnalysis : false
@@ -387,6 +387,21 @@ describe('MongoCryptConstructor', () => {
387
387
) . to . be . instanceOf ( MongoCryptContextCtor ) ;
388
388
} ) ;
389
389
} ) ;
390
+
391
+
392
+ describe ( 'options.expressionMode' , function ( ) {
393
+ it ( 'throws if `expressionMode` is not defined' , function ( ) {
394
+ expect ( ( ) =>
395
+ mc . makeExplicitEncryptionContext ( value , {
396
+ // minimum required arguments from libmongocrypt
397
+ keyId : keyId . buffer ,
398
+ algorithm : 'Unindexed'
399
+ } )
400
+ )
401
+ . to . throw ( / o p t i o n ` e x p r e s s i o n M o d e ` i s r e q u i r e d ./ )
402
+ . to . be . instanceOf ( TypeError ) ;
403
+ } ) ;
404
+ } )
390
405
} ) ;
391
406
} ) ;
392
407
0 commit comments