@@ -1405,9 +1405,6 @@ describe('encryption integration tests', () => {
14051405 } ) ;
14061406
14071407 describe ( 'QE encrypted queries' , function ( ) {
1408- beforeEach ( function ( ) {
1409- this . timeout ( 5_000 ) ;
1410- } ) ;
14111408 describe ( 'when a field is configured for equality queries' , function ( ) {
14121409 it ( 'can be queried with mongoose' , async function ( ) {
14131410 connection = mongoose . createConnection ( ) ;
@@ -1416,6 +1413,7 @@ describe('encryption integration tests', () => {
14161413 } , { encryptionType : 'queryableEncryption' } ) ;
14171414 const model = connection . model ( new UUID ( ) . toHexString ( ) , schema ) ;
14181415 await connection . openUri ( process . env . MONGOOSE_TEST_URI , autoEncryptionOptions ( ) ) ;
1416+ await model . init ( ) ;
14191417
14201418 await model . insertMany ( [ { name : 'bailey' } , { name : 'john' } ] ) ;
14211419
@@ -1431,10 +1429,10 @@ describe('encryption integration tests', () => {
14311429 name : { type : String , encrypt : { keyId } }
14321430 } , { encryptionType : 'queryableEncryption' } ) ;
14331431 const model = connection . model ( new UUID ( ) . toHexString ( ) , schema ) ;
1434- await model . init ( ) ;
14351432 await connection . openUri ( process . env . MONGOOSE_TEST_URI , autoEncryptionOptions ( ) ) ;
1433+ await model . init ( ) ;
14361434
1437- await model . insertMany ( [ { name : { toString : function ( ) { 'asdf' ; } } } , { name : 'john' } ] ) ;
1435+ await model . insertMany ( [ { name : 'bailey' } , { name : 'john' } ] ) ;
14381436
14391437 await assert . rejects ( ( ) => {
14401438 return model . findOne ( { name : 'bailey' } ) ;
0 commit comments