Releases: alonronin/mockingoose
Releases · alonronin/mockingoose
Add support for Model.insertMany
Remove TypeScript, Support UpdateOne and UpdateMany
I decided to remove typescript since changes in mongoose broke monckingoose without good reason.
now mockingoose works with latest version of mongoose.
closes #68
Update Dependencies
v2.13.1 :bookmark: 2.13.1
Using function to Mock, Convert to TypeScript
What a release we have, thanx @andreialecu for the great hard work and @stieg for his ideas and comments.
So now you can use a function as your mock.
Also we converted the project to TypeScript so you have now a better intellisense in your editor and of course strong typing and compile type checks.
Welcome @andreialecu as a collaborater!
Save Hook
countDocuments and estimatedDocumentCount support
Thanx to @sepulvedablanco for PR #43 and #42 added 2 new operators.
Support Aggrregate
Now you can mock the Aggregate framework:
it('should aggregate with promise', () => {
mockingoose.User.toReturn([{ _id: { accountId: '5aef17c3d7c488f401c101bd' } }], 'aggregate');
return User
.aggregate(
[{
'$group': {
'_id': {
'accountId': '$accountId'
}
}
}])
.then(result => {
expect(result).toEqual([{ _id: { accountId: '5aef17c3d7c488f401c101bd' } }]);
});
});
v2.10.0
Support Model.remove
support remove
on Model instance. Thanx to @KevinRLeC on PR #24.
Support mongoose 5
- Support mongoose 5
- Remove
mongoose.Promise
for version 5