Socket
Socket
Sign inDemoInstall

@deliverysolutions/mongoat

Package Overview
Dependencies
159
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.7 to 3.0.1-beta.0

6

package.json
{
"name": "@deliverysolutions/mongoat",
"version": "2.1.7",
"version": "3.0.1-beta.0",
"description": "Mongoat is a MongoDb ODM",

@@ -15,3 +15,2 @@ "keywords": [

"scripts": {
"pretest": "jshint .",
"test": "jasmine",

@@ -32,3 +31,3 @@ "cover": "istanbul cover ./node_modules/.bin/jasmine",

"lodash": "^4.0.0",
"mongodb": "^3.5.7"
"mongodb": "^4.2.0"
},

@@ -40,2 +39,3 @@ "devDependencies": {

"jsdoc": "^3.4.0",
"jshint": "^2.13.1",
"minami": "^1.1.1"

@@ -42,0 +42,0 @@ },

@@ -15,5 +15,6 @@ 'use strict';

mongoat.MongoClient.connect('mongodb://localhost:27017/mongoatTest')
.then(function (db) {
_this.testDb = db;
return db.dropDatabase();
.then(function (client) {
_this.testDb = client.db('mongoatTest');
_this.client = client;
return _this.testDb.dropDatabase();
})

@@ -41,6 +42,6 @@ .then(function () {

.then(function () {
_this.testDb.dropDatabase();
return _this.testDb.dropDatabase();
})
.then(function () {
_this.testDb.close();
return _this.client.close();
})

@@ -47,0 +48,0 @@ .then(done);

@@ -15,5 +15,6 @@ 'use strict';

mongoat.MongoClient.connect('mongodb://localhost:27017/mongoatTest')
.then(function (db) {
_this.testDb = db;
return db.dropDatabase();
.then(function (client) {
_this.testDb = client.db('mongoatTest');
_this.client = client;
return _this.testDb.dropDatabase();
})

@@ -46,6 +47,6 @@ .then(function () {

.then(function () {
_this.testDb.dropDatabase();
return _this.testDb.dropDatabase();
})
.then(function () {
_this.testDb.close();
return _this.client.close();
})

@@ -64,8 +65,7 @@ .then(done);

expect(typeof mongObject).toBe('object');
expect(typeof mongObject.result).toBe('object');
expect(mongObject.result.ok).toBe(1);
expect(mongObject.result.n).toBe(1);
expect(mongObject.insertedCount).toBe(1);
expect(mongObject.acknowledged).toBe(true);
done();
});
});
})

@@ -82,5 +82,4 @@ // test insert without hooks

expect(typeof mongObject).toBe('object');
expect(typeof mongObject.result).toBe('object');
expect(mongObject.result.ok).toBe(1);
expect(mongObject.result.n).toBe(1);
expect(mongObject.insertedCount).toBe(1);
expect(mongObject.acknowledged).toBe(true);
done();

@@ -124,10 +123,2 @@ });

document.email = 'khatal.yacine@gmail.com';
return document;
});
_this.testCol.before('insert', function (document) {
expect(document.firstName).toBe('Yacine');
expect(document.lastName).toBe('KHATAL');
expect(document.age).toBe(25);
expect(document.email).toBe('khatal.yacine@gmail.com');
document.company = 'Dial Once';

@@ -139,19 +130,13 @@ return document;

_this.testCol.after('insert', function (mongObject) {
expect(mongObject.ops[0].firstName).toBe('Yacine');
expect(mongObject.ops[0].lastName).toBe('KHATAL');
expect(mongObject.ops[0].age).toBe(25);
expect(mongObject.ops[0].email).toBe('khatal.yacine@gmail.com');
expect(mongObject.ops[0].company).toBe('Dial Once');
return mongObject;
_this.testCol.findOne({ _id : mongObject.insertedIds['0'] })
.then((insertedObj) => {
expect(insertedObj.firstName).toBe('Yacine');
expect(insertedObj.lastName).toBe('KHATAL');
expect(insertedObj.age).toBe(25);
expect(insertedObj.email).toBe('khatal.yacine@gmail.com');
expect(insertedObj.company).toBe('Dial Once');
return mongObject;
})
});
_this.testCol.after('insert', function (mongObject) {
expect(mongObject.ops[0].firstName).toBe('Yacine');
expect(mongObject.ops[0].lastName).toBe('KHATAL');
expect(mongObject.ops[0].age).toBe(25);
expect(mongObject.ops[0].email).toBe('khatal.yacine@gmail.com');
expect(mongObject.ops[0].company).toBe('Dial Once');
return mongObject;
});
_this.testCol.insert({

@@ -164,10 +149,4 @@ firstName: 'Yacine',

expect(typeof mongObject).toBe('object');
expect(typeof mongObject.result).toBe('object');
expect(mongObject.result.ok).toBe(1);
expect(mongObject.result.n).toBe(1);
expect(mongObject.ops[0].firstName).toBe('Yacine');
expect(mongObject.ops[0].lastName).toBe('KHATAL');
expect(mongObject.ops[0].age).toBe(25);
expect(mongObject.ops[0].email).toBe('khatal.yacine@gmail.com');
expect(mongObject.ops[0].company).toBe('Dial Once');
expect(mongObject.insertedCount).toBe(1);
expect(mongObject.acknowledged).toBe(true);
})

@@ -174,0 +153,0 @@ .then(done);

@@ -16,4 +16,5 @@ 'use strict';

.then(function (db) {
_this.testDb = db;
return db.dropDatabase();
_this.testDb = client.db('mongoatTest');
_this.client = client;
return _this.testDb.dropDatabase();
})

@@ -35,6 +36,6 @@ .then(function () {

.then(function () {
_this.testDb.dropDatabase();
return _this.testDb.dropDatabase();
})
.then(function () {
_this.testDb.close();
return _this.client.close();
})

@@ -41,0 +42,0 @@ .then(done);

@@ -16,4 +16,5 @@ 'use strict';

.then(function (db) {
_this.testDb = db;
return db.dropDatabase();
_this.testDb = client.db('mongoatTest');
_this.client = client;
return _this.testDb.dropDatabase();
})

@@ -45,6 +46,6 @@ .then(function () {

.then(function () {
_this.testDb.dropDatabase();
return _this.testDb.dropDatabase();
})
.then(function () {
_this.testDb.close();
return _this.client.close();
})

@@ -51,0 +52,0 @@ .then(done);

@@ -15,4 +15,5 @@ 'use strict';

.then(function (db) {
_this.testDb = db;
return db.dropDatabase();
_this.testDb = client.db('mongoatTest');
_this.client = client;
return _this.testDb.dropDatabase();
})

@@ -146,3 +147,3 @@ .then(function () {

.then(function () {
return _this.testDb.close();
return _this.client.close();
})

@@ -149,0 +150,0 @@ .then(done);

@@ -17,4 +17,5 @@ 'use strict';

.then(function (db) {
_this.testDb = db;
return db.dropDatabase();
_this.testDb = client.db('mongoatTest');
_this.client = client;
return _this.testDb.dropDatabase();
})

@@ -59,6 +60,6 @@ .then(function () {

.then(function () {
_this.testDb.dropDatabase();
return _this.testDb.dropDatabase();
})
.then(function () {
_this.testDb.close();
return _this.client.close();
})

@@ -65,0 +66,0 @@ .then(done);

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc