Skip to content

Mockingoose v2.3.0

Compare
Choose a tag to compare
@alonronin alonronin released this 29 Sep 14:17
· 134 commits to master since this release

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();
})