I tried with
const mock = TypeMoq.Mock.ofInstance(userModel)
mock
.setup(x => x.findOne(TypeMoq.It.isAny()))
.returns(() => ({username: 'test', gender: 'female'}))
But it doesn't work.
- It claims that userModel doesn't have an
findOnemethod - The returns won't pass compilation because
{username: 'test', gender: 'female'}is not aDocumentQueryobject.