Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mockingoose

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockingoose - npm Package Compare versions

Comparing version 2.9.0 to 2.9.1

16

lib/index.js

@@ -107,12 +107,16 @@ 'use strict';

_mongoose2.default.Model.prototype.save = jest.fn().mockImplementation(function (options, cb) {
var op = 'save';
var modelName = this.constructor.modelName;
var instance = ['remove', 'save'];
instance.forEach(function (methodName) {
_mongoose2.default.Model.prototype[methodName] = jest.fn().mockImplementation(function (options, cb) {
var op = methodName;
var modelName = this.constructor.modelName;
if (typeof options === 'function') cb = options;
Object.assign(this, { op: op, model: { modelName: modelName } });
if (typeof options === 'function') cb = options;
return mockedReturn.call(this, cb);
Object.assign(this, { op: op, model: { modelName: modelName } });
return mockedReturn.call(this, cb);
});
});

@@ -119,0 +123,0 @@

{
"name": "mockingoose",
"version": "2.9.0",
"version": "2.9.1",
"description": "A Jest package for mocking mongoose models",

@@ -5,0 +5,0 @@ "main": "./lib",

@@ -157,4 +157,5 @@ # Mockingoose

- [x] Return `Jest.fn` for `Model.save` mock;
- [x] Return `Jest.fn` for `Model.save` mock
- [ ] Support `Model.aggregate`
[logo]: http://animals.sandiegozoo.org/sites/default/files/2016-12/DwarfMongoose_ZN.jpg

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc