@@ -1196,49 +1196,3 @@ async function gh15947() {
11961196 docArr : [ { _id : '6951265a11a2b0976013be20' } ]
11971197 } ) ;
11981198}
1199-
1200- function hydrateWithStrictOption ( ) {
1201- const schema = new mongoose . Schema ( {
1202- name : String ,
1203- age : Number
1204- } , { strict : true } ) ;
1205-
1206- const TestModel = mongoose . model ( 'Test' , schema ) ;
1207-
1208- // Test with strict: false
1209- const doc1 = TestModel . hydrate ( {
1210- _id : new mongoose . Types . ObjectId ( ) ,
1211- name : 'John' ,
1212- age : 30 ,
1213- extraField : 'value'
1214- } , undefined , { strict : false } ) ;
1215-
1216- expectType < ReturnType < ( typeof TestModel ) [ 'hydrate' ] > > ( doc1 ) ;
1217-
1218- // Test with strict: true
1219- const doc2 = TestModel . hydrate ( {
1220- _id : new mongoose . Types . ObjectId ( ) ,
1221- name : 'Jane' ,
1222- age : 25
1223- } , undefined , { strict : true } ) ;
1224-
1225- expectType < ReturnType < ( typeof TestModel ) [ 'hydrate' ] > > ( doc2 ) ;
1226-
1227- // Test with strict: 'throw'
1228- const doc3 = TestModel . hydrate ( {
1229- _id : new mongoose . Types . ObjectId ( ) ,
1230- name : 'Bob' ,
1231- age : 35
1232- } , undefined , { strict : 'throw' } ) ;
1233-
1234- expectType < ReturnType < ( typeof TestModel ) [ 'hydrate' ] > > ( doc3 ) ;
1235-
1236- // Test without strict option
1237- const doc4 = TestModel . hydrate ( {
1238- _id : new mongoose . Types . ObjectId ( ) ,
1239- name : 'Alice' ,
1240- age : 28
1241- } ) ;
1242-
1243- expectType < ReturnType < ( typeof TestModel ) [ 'hydrate' ] > > ( doc4 ) ;
1244- }
0 commit comments