Comparing version 0.0.1 to 0.0.2
@@ -7,3 +7,3 @@ { | ||
"homepage": "https://github.com/nearinfinity/node-openport", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"engines": { "node" : ">=0.6.0" }, | ||
@@ -10,0 +10,0 @@ "maintainers": [ |
@@ -35,3 +35,4 @@ # openport | ||
startingPort: 1024, | ||
endingPort: 2000 | ||
endingPort: 2000, | ||
avoid: [ 1025, 1500 ] | ||
} | ||
@@ -38,0 +39,0 @@ function(err, port) { |
@@ -19,2 +19,44 @@ 'use strict'; | ||
'find a port not in the avoid list': function (test) { | ||
op.find( | ||
{ | ||
ports: [ 1024, 1025, 1026, 1027 ], | ||
avoid: [ 1025, 1026 ], | ||
count: 2 | ||
}, | ||
function (err, ports) { | ||
test.ok(!err); | ||
test.deepEqual([1024, 1027], ports); | ||
test.done(); | ||
}); | ||
}, | ||
'find a port not in the avoid list outer case': function (test) { | ||
op.find( | ||
{ | ||
ports: [ 1024, 1025, 1026, 1027 ], | ||
avoid: [ '1024', '1027' ], | ||
count: 2 | ||
}, | ||
function (err, ports) { | ||
test.ok(!err); | ||
test.deepEqual([1025, 1026], ports); | ||
test.done(); | ||
}); | ||
}, | ||
'find a port not in the avoid list starting port': function (test) { | ||
op.find( | ||
{ | ||
startingPort: 1024, | ||
avoid: [ 1024, 1026 ], | ||
count: 2 | ||
}, | ||
function (err, ports) { | ||
test.ok(!err); | ||
test.deepEqual([1025, 1027], ports); | ||
test.done(); | ||
}); | ||
}, | ||
'port that requires sudo': function (test) { | ||
@@ -21,0 +63,0 @@ op.find( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
111808
10077
44