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

mongojs-hooks

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongojs-hooks - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

4

package.json
{
"name": "mongojs-hooks",
"description": "Wrap monogjs in pre and post hooks",
"version": "0.1.3",
"version": "0.1.4",
"main": "./mongojs-hooks",

@@ -14,3 +14,3 @@ "author": {

"dependencies": {
"mongojs": "0.9.x",
"mongojs": "0.18.x",
"fn-hooks": "0.1.x",

@@ -17,0 +17,0 @@ "lodash": "2.4.x"

require("should");
var sinon = require("sinon");
var stream = require("stream");
var mongo = require("../mongojs-hooks");

@@ -216,46 +215,3 @@ var mongojs = require("mongojs");

});
describe("when streaming", function () {
var findStub;
beforeEach(function () {
//findStub = sinon.stub(mongojs.Collection.prototype, "find").callsArg(1);
});
afterEach(function () {
//findStub.restore();
});
it("with post() hook should get called before next transform in pipeline", function (done) {
var tests = mongo.collection("tests");
var postStub = sinon.stub();
tests.post("find", function (next) {
console.log("HERE", arguments);
// mongojs.Collection.prototype.find.calledWith({ test: "property" }).should.be.ok;
// postStub();
next();
});
var transform = stream.Transform({ objectMode: true });
transform._transform = function (object, enc, next) {
console.log("trans", object);
next();
};
// db.collection("tests").find({ test: "property" }, function () {
// postStub.callCount.should.equal(1);
// done();
// });
db.collection("tests").find({ test: "property" })
.pipe(transform)
.on("finish", done);
});
});
});
});

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