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

mongo-unit

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongo-unit - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

.mongo-unit/diagnostic.data/metrics.2017-09-13T09-16-11Z-00000

17

index.js

@@ -5,3 +5,3 @@ 'use strict';

const portfinder = require('portfinder')
const mongodbServer = require('mongodb-prebuilt')
const {MongodHelper} = require('mongodb-prebuilt')
const client = require('mongodb').MongoClient

@@ -35,8 +35,8 @@ const fs = require('fs')

mongo_opts.args.port = port
if (mongodbServer.start_server(mongo_opts,(err)=>{console.log('mongo start error', err)}) === 0) {
dbUrl = 'mongodb://localhost:' + port+'/'+mongo_opts.dbName
return dbUrl
} else {
return Promise.reject('cannot start mongod')
}
const mongodHelper = new MongodHelper(['--port', port, '--dbpath', mongo_opts.args.dbpath,'--storageEngine', 'ephemeralForTest']);
return mongodHelper.run()
.then(()=>{
dbUrl = 'mongodb://localhost:' + port+'/'+mongo_opts.dbName
return dbUrl
})
})

@@ -86,2 +86,3 @@ }

if (err) {
console.log('cannot get free port', err)
reject(err)

@@ -99,2 +100,3 @@ } else {

if (e.code !== "EEXIST") {
console.log('cannot create db folder', dir, e)
throw e;

@@ -113,2 +115,3 @@ }

if (err) {
console.log('ps-node error', err)
return reject( err )

@@ -115,0 +118,0 @@ }

{
"name": "mongo-unit",
"version": "1.0.3",
"version": "1.1.0",
"description": "mongo db for unit tests",

@@ -8,3 +8,4 @@ "main": "index.js",

"test": "mocha test.js",
"test-basic": "mocha ./examples/basic.js"
"test-basic": "mocha ./examples/basic.js",
"release": "git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
},

@@ -33,4 +34,4 @@ "repository": {

"dependencies": {
"mongodb": "^2.2.19",
"mongodb-prebuilt": "^5.0.8",
"mongodb": "~2.2.31",
"mongodb-prebuilt": "~6.3.3",
"portfinder": "^1.0.10",

@@ -37,0 +38,0 @@ "ps-node": "^0.1.4"

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