Mockingoose v2.3.0
Now supports empty responses, thanks to @noamokman for the PR.
mockingoose.User.toReturn([]);
return User
.find()
.then(result => {
expect(result).toHaveLength(0);
})
or
mockingoose.User.toReturn(null);
return User
.findOne()
.then(result => {
expect(result).toBeFalsy();
})