mongodb-memory-server-core
Advanced tools
Comparing version 9.1.0-beta.4 to 9.1.0-beta.5
@@ -44,2 +44,3 @@ "use strict"; | ||
} | ||
const exp_net0listen = (0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.EXP_NET0LISTEN)); | ||
let tries = 0; | ||
@@ -49,3 +50,3 @@ while (tries <= max_tries) { | ||
let nextPort; | ||
if ((0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.EXP_NET0LISTEN))) { | ||
if (exp_net0listen) { | ||
// "0" means to use ".listen" random port | ||
@@ -59,3 +60,4 @@ nextPort = tries === 1 ? firstPort : 0; | ||
// try next port, because it is already in the cache | ||
if (PORTS_CACHE.ports.has(nextPort)) { | ||
// unless port is "0" which will use "net.listen(0)" | ||
if (PORTS_CACHE.ports.has(nextPort) && nextPort !== 0) { | ||
continue; | ||
@@ -67,2 +69,4 @@ } | ||
const triedPort = await tryPort(nextPort); | ||
// returned port can be different than the "nextPort" (if EXP_NET0LISTEN) | ||
PORTS_CACHE.ports.add(nextPort); | ||
if (triedPort > 0) { | ||
@@ -69,0 +73,0 @@ return triedPort; |
{ | ||
"name": "mongodb-memory-server-core", | ||
"version": "9.1.0-beta.4", | ||
"version": "9.1.0-beta.5", | ||
"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.", | ||
@@ -34,9 +34,9 @@ "main": "lib/index", | ||
"devDependencies": { | ||
"@types/debug": "^4.1.10", | ||
"@types/debug": "^4.1.12", | ||
"@types/find-cache-dir": "^3.2.1", | ||
"@types/follow-redirects": "^1.14.3", | ||
"@types/semver": "^7.5.4", | ||
"@types/tar-stream": "^3.1.2", | ||
"@types/yauzl": "^2.10.2", | ||
"@types/yazl": "^2.4.4", | ||
"@types/follow-redirects": "^1.14.4", | ||
"@types/semver": "^7.5.5", | ||
"@types/tar-stream": "^3.1.3", | ||
"@types/yauzl": "^2.10.3", | ||
"@types/yazl": "^2.4.5", | ||
"rimraf": "^5.0.5", | ||
@@ -43,0 +43,0 @@ "yazl": "^2.5.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
379971
5597