Skip to content

Commit

Permalink
test: extend test case for Automattic#11960 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Jun 28, 2022
1 parent a0cd934 commit b6b0973
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/types/document.test.ts
Expand Up @@ -240,4 +240,18 @@ async function gh11960() {
doc.nested!.parent();
doc.nestedArray?.[0].parentArray();
}

{
const doc = await ParentModel.create({
username: 'user1',
map: { key1: 'value1', key2: 'value2' },
nested: { dummy: 'hello' },
nestedArray: [{ dummy: 'hello again' }]
});

expectType<Document<any, any, any> & Parent & { _id: Types.ObjectId }>(doc);
expectType<Map<string, string> | undefined>(doc.map);
doc.nested!.parent();
doc.nestedArray?.[0].parentArray();
}
}

0 comments on commit b6b0973

Please sign in to comment.