Socket
Socket
Sign inDemoInstall

mongodb-memory-server-core

Package Overview
Dependencies
Maintainers
1
Versions
273
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-memory-server-core - npm Package Compare versions

Comparing version 5.1.5 to 5.1.8

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [5.1.8](https://github.com/nodkz/mongodb-memory-server/compare/v5.1.7...v5.1.8) (2019-07-23)
### Bug Fixes
* wait until primary is transitioned from secondary for replicaSet ([596fed8](https://github.com/nodkz/mongodb-memory-server/commit/596fed8))
## [5.1.5](https://github.com/nodkz/mongodb-memory-server/compare/v5.1.4...v5.1.5) (2019-06-18)

@@ -8,0 +19,0 @@

20

lib/MongoMemoryReplSet.js

@@ -213,8 +213,8 @@ "use strict";

}
this.servers = servers;
// Brief delay to wait for servers to start up.
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
// ensures all servers are listening for connection
return [4 /*yield*/, Promise.all(servers.map(function (s) { return s.start(); }))];
case 1:
// Brief delay to wait for servers to start up.
// ensures all servers are listening for connection
_a.sent();
this.servers = servers;
return [4 /*yield*/, this._initReplSet()];

@@ -332,3 +332,3 @@ case 2:

var serverOpts = {
autoStart: true,
autoStart: false,
debug: this.opts.debug,

@@ -352,10 +352,14 @@ binary: this.opts.binary,

}
return [4 /*yield*/, this.admin.command({ replSetGetStatus: 1 })];
return [4 /*yield*/, this.admin.command({
serverStatus: 1,
metrics: 0,
locks: 0,
})];
case 1:
replStatus = _a.sent();
this.debug(' replStatus:', replStatus);
hasPrimary = replStatus.members.some(function (m) { return m.stateStr === 'PRIMARY'; });
hasPrimary = replStatus.repl.ismaster;
if (!hasPrimary) {
this.debug('No PRIMARY yet. Waiting...');
return [2 /*return*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(_this._waitForPrimary()); }, 1000); })];
return [2 /*return*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(_this._waitForPrimary()); }, 500); })];
}

@@ -362,0 +366,0 @@ return [2 /*return*/, true];

12

lib/types.d.ts

@@ -26,14 +26,8 @@ export declare type DebugFn = (...args: any[]) => any;

}
export interface ReplStatusMemberT {
_id: number;
name: string;
health: number;
state: number;
stateStr: string;
uptime: number;
export interface ReplStatusReplT {
ismaster: boolean;
}
export interface ReplStatusResultT {
set: string;
members: ReplStatusMemberT[];
repl: ReplStatusReplT;
}
//# sourceMappingURL=types.d.ts.map
{
"name": "mongodb-memory-server-core",
"version": "5.1.5",
"version": "5.1.8",
"description": "MongoDB Server for testing (core package, without autodownload). The server will allow you to connect your favourite ODM or client library to the MongoDB Server and run parallel integration tests isolated from each other.",

@@ -56,3 +56,3 @@ "main": "lib/index",

},
"gitHead": "35f755b0eac38510088d7bfb6b525a27f47e5ef3"
"gitHead": "f7487884f34e84a9790d15065b42e09776f56613"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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