mongojs-hooks
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23159
427
+ Addedabort-controller@3.0.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbson@0.2.22(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedkerberos@0.0.9(transitive)
+ Addedmongodb@1.4.32(transitive)
+ Addedmongojs@0.18.2(transitive)
+ Addednan@1.6.21.8.4(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedreadable-stream@4.5.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removedbson@0.2.2(transitive)
- Removedkerberos@0.0.3(transitive)
- Removedmongodb@1.3.19(transitive)
- Removedmongojs@0.9.11(transitive)
Updatedmongojs@0.18.x