Skip to content

Commit d9270fd

Browse files
committed
test: add extra if populated check to hydrate test #15048
1 parent b34aba6 commit d9270fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/model.hydrate.test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,13 @@ describe('model', function() {
109109
});
110110

111111
db.model('UserTestHydrate', userSchema);
112-
const Company = db.model('CompanyTestHyrdrate', companySchema);
112+
const Company = db.model('CompanyTestHydrate', companySchema);
113113

114114
const users = [{ _id: new mongoose.Types.ObjectId(), name: 'Val' }];
115115
const company = { _id: new mongoose.Types.ObjectId(), name: 'Booster', users: [users[0]] };
116116

117117
const C = Company.hydrate(company, null, { hydratedPopulatedDocs: true });
118+
assert(C.populated('users'));
118119
assert.equal(C.users[0].name, 'Val');
119120
});
120121
it('should hydrate documents in virtual populate (gh-14503)', async function() {

0 commit comments

Comments
 (0)