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.2.0 to 1.3.0

.circleci/config.yml

13

index.js
'use strict';
//process.env.DEBUG= '*'
const Debug = require('debug')

@@ -18,2 +17,3 @@ const portfinder = require('portfinder')

var mongodHelper
var dbUrl

@@ -24,3 +24,3 @@

opts.port = port
const mongodHelper = new MongodHelper(['--port', port, '--dbpath', opts.dbpath,'--storageEngine', 'ephemeralForTest']);
mongodHelper = new MongodHelper(['--port', port, '--dbpath', opts.dbpath,'--storageEngine', 'ephemeralForTest']);
return mongodHelper.run()

@@ -50,2 +50,10 @@ .then(()=>{

function delay(time){
return new Promise(resolve=>setTimeout(resolve, time))
}
function stop(){
mongodHelper && mongodHelper.mongoBin.childProcess.kill()
return delay(100) //this is small delay to make sure kill signal is sent
}
function getUrl() {

@@ -154,2 +162,3 @@ if(dbUrl){

start,
stop,
getUrl,

@@ -156,0 +165,0 @@ load,

2

package.json
{
"name": "mongo-unit",
"version": "1.2.0",
"version": "1.3.0",
"description": "mongo db for unit tests",

@@ -5,0 +5,0 @@ "main": "index.js",

# mongo-unit
[![build status](https://travis-ci.org/mikhail-angelov/mongo-unit.svg?branch=master)](https://travis-ci.org/mikhail-angelov/mongo-unit)
[![CircleCI](https://circleci.com/gh/mikhail-angelov/mongo-unit.svg?style=svg)](https://circleci.com/gh/mikhail-angelov/mongo-unit)
[![NPM](https://nodei.co/npm/mongo-unit.png)](https://nodei.co/npm/mongo-unit)

@@ -30,3 +31,6 @@

`opts.verbose` - enable debug informaton for mongodb-prebuilt, default: `false`
### `stop()`
It stops mongod process
### `getUrl()`

@@ -57,2 +61,8 @@ Syncronius API returns URL to connect to test db, if test DB is not started it thows an Exception

### `initDb(url, data)`
helper function, load db data into mongo (url)
### `dropDb(url)`
helper function, clear all db data from mongo (url)
### Basic Usage

@@ -59,0 +69,0 @@

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