mongo-unit
Advanced tools
Comparing version 1.0.3 to 1.1.0
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" |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
117
4
64140
16
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddecompress@4.2.1(transitive)
+ Addeddecompress-tar@4.1.1(transitive)
+ Addeddecompress-tarbz2@4.1.1(transitive)
+ Addeddecompress-targz@4.1.1(transitive)
+ Addeddecompress-unzip@4.0.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfile-type@5.2.06.2.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedfs-extra@2.1.2(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedget-stream@2.3.1(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedis-natural-number@4.0.1(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsonfile@2.4.0(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmake-dir@1.3.0(transitive)
+ Addedmd5-file@3.1.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmongodb-download@2.2.7(transitive)
+ Addedmongodb-prebuilt@6.3.6(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpify@2.3.03.0.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrequest-promise@4.2.6(transitive)
+ Addedrequest-promise-core@1.1.4(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstealthy-require@1.1.1(transitive)
+ Addedstrip-dirs@2.1.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedunbzip2-stream@1.4.3(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
- Removedagent-base@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedarr-diff@2.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarray-unique@0.2.1(transitive)
- Removedbraces@1.8.5(transitive)
- Removedbuffer-to-vinyl@1.1.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedclone@0.2.01.0.4(transitive)
- Removedclone-stats@0.0.1(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removeddecompress@3.0.0(transitive)
- Removeddecompress-tar@3.1.0(transitive)
- Removeddecompress-tarbz2@3.1.0(transitive)
- Removeddecompress-targz@3.1.0(transitive)
- Removeddecompress-unzip@3.4.0(transitive)
- Removedduplexer2@0.1.4(transitive)
- Removedduplexify@3.7.1(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedexpand-brackets@0.1.5(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.1(transitive)
- Removedextglob@0.3.2(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.4(transitive)
- Removedfirst-chunk-stream@1.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedglob@5.0.15(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.03.1.0(transitive)
- Removedglob-stream@5.3.5(transitive)
- Removedgulp-sourcemaps@1.6.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhttps-proxy-agent@1.0.0(transitive)
- Removedis-absolute@0.1.7(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-bzip2@1.0.0(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@0.1.1(transitive)
- Removedis-extglob@1.0.02.1.1(transitive)
- Removedis-glob@2.0.13.1.0(transitive)
- Removedis-gzip@1.0.0(transitive)
- Removedis-natural-number@2.1.1(transitive)
- Removedis-number@2.1.04.0.0(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-relative@0.1.3(transitive)
- Removedis-tar@1.0.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedis-valid-glob@0.3.0(transitive)
- Removedis-zip@1.0.0(transitive)
- Removedisarray@0.0.1(transitive)
- Removedisobject@2.1.0(transitive)
- Removedjson-stable-stringify-without-jsonify@1.0.1(transitive)
- Removedkind-of@3.2.26.0.3(transitive)
- Removedlazystream@1.0.1(transitive)
- Removedlodash.isequal@4.5.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmerge-stream@1.0.1(transitive)
- Removedmicromatch@2.3.11(transitive)
- Removedmongodb-download@1.3.2(transitive)
- Removedmongodb-prebuilt@5.0.8(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject-assign@2.1.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedordered-read-streams@0.3.0(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedread-all-stream@3.1.0(transitive)
- Removedreadable-stream@1.0.343.6.2(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedreplace-ext@0.0.1(transitive)
- Removedsemver@5.0.3(transitive)
- Removedstat-mode@0.2.2(transitive)
- Removedstream-combiner2@1.1.1(transitive)
- Removedstream-shift@1.0.3(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-bom-stream@1.0.0(transitive)
- Removedstrip-dirs@1.1.1(transitive)
- Removedsum-up@1.0.3(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedthrough2@0.6.52.0.54.0.2(transitive)
- Removedthrough2-filter@2.0.03.1.0(transitive)
- Removedto-absolute-glob@0.1.1(transitive)
- Removedunique-stream@2.3.1(transitive)
- Removeduuid@2.0.3(transitive)
- Removedvali-date@1.0.0(transitive)
- Removedvinyl@0.4.61.2.0(transitive)
- Removedvinyl-assign@1.2.1(transitive)
- Removedvinyl-fs@2.4.4(transitive)
Updatedmongodb@~2.2.31
Updatedmongodb-prebuilt@~6.3.3