@@ -429,7 +429,7 @@ describe('insertMany()', function() {
429429 assert . ok ( ! err . mongoose . validationErrors [ 1 ] . errors [ 'name' ] ) ;
430430 } ) ;
431431
432- it ( 'insertMany() validation errors include index and doc properties with ordered false and rawResult' , async function ( ) {
432+ it ( 'insertMany() validation errors include index property with ordered false and rawResult' , async function ( ) {
433433 const schema = new Schema ( {
434434 title : { type : String , required : true } ,
435435 requiredField : { type : String , required : true }
@@ -451,19 +451,15 @@ describe('insertMany()', function() {
451451 // Check first validation error (index 1)
452452 const error1 = res . mongoose . validationErrors [ 0 ] ;
453453 assert . equal ( error1 . index , 1 ) ;
454- assert . ok ( error1 . doc ) ;
455- assert . equal ( error1 . doc . title , 'title2' ) ;
456454 assert . ok ( error1 . errors [ 'requiredField' ] ) ;
457455
458456 // Check second validation error (index 2)
459457 const error2 = res . mongoose . validationErrors [ 1 ] ;
460458 assert . equal ( error2 . index , 2 ) ;
461- assert . ok ( error2 . doc ) ;
462- assert . equal ( error2 . doc . requiredField , 'field3' ) ;
463459 assert . ok ( error2 . errors [ 'title' ] ) ;
464460 } ) ;
465461
466- it ( 'insertMany() validation errors include index and doc properties with throwOnValidationError' , async function ( ) {
462+ it ( 'insertMany() validation errors include index property with throwOnValidationError' , async function ( ) {
467463 const schema = new Schema ( {
468464 title : { type : String , required : true } ,
469465 requiredField : { type : String , required : true }
@@ -485,15 +481,11 @@ describe('insertMany()', function() {
485481 // Check first validation error (index 1)
486482 const error1 = err . validationErrors [ 0 ] ;
487483 assert . equal ( error1 . index , 1 ) ;
488- assert . ok ( error1 . doc ) ;
489- assert . equal ( error1 . doc . title , 'title2' ) ;
490484 assert . ok ( error1 . errors [ 'requiredField' ] ) ;
491485
492486 // Check second validation error (index 2)
493487 const error2 = err . validationErrors [ 1 ] ;
494488 assert . equal ( error2 . index , 2 ) ;
495- assert . ok ( error2 . doc ) ;
496- assert . equal ( error2 . doc . requiredField , 'field3' ) ;
497489 assert . ok ( error2 . errors [ 'title' ] ) ;
498490 } ) ;
499491
0 commit comments