Skip to content

Commit fa05c97

Browse files
committed
Add sub test - Empty instance
1 parent 5dca238 commit fa05c97

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/emptyInstance.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,18 @@ export function emptyInstance(repository: any) {
7373

7474
// Note: Populate should not work in this case
7575
});
76+
77+
it('should create empty instance', async function () {
78+
await PersonModel.findAndDelete({});
79+
await OrganizationModel.findAndDelete({});
80+
81+
const org = OrganizationModel({}, {});
82+
await org.save();
83+
const org2 = OrganizationModel({}, {uri: "http://orgTest2"});
84+
await org2.save();
85+
86+
const orgs = await OrganizationModel.find({});
87+
expect(orgs).length(2);
88+
});
7689
}
7790
}

0 commit comments

Comments
 (0)