Skip to content

Commit

Permalink
test(types): add types-test for find & findOne with ObjectId argument
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Sep 30, 2022
1 parent 3107642 commit 2ab2186
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/types/models.test.ts
Expand Up @@ -520,3 +520,10 @@ async function gh12319() {

expectType<ProjectModelHydratedDoc>(await ProjectModel.findOne().orFail());
}

function findWithId() {
const id = new Types.ObjectId();
const TestModel = model('test', new Schema({}));
TestModel.find(id);
TestModel.findOne(id);
}

0 comments on commit 2ab2186

Please sign in to comment.