browserstacktunnel-wrapper
Advanced tools
Comparing version 1.3.1 to 1.4.0
{ | ||
"name": "browserstacktunnel-wrapper", | ||
"description": "A Node.js wrapper for the BrowserStack java tunnel client ", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"homepage": "https://github.com/pghalliday/node-BrowserStackTunnel.git", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -28,3 +28,3 @@ node-BrowserStackTunnel | ||
sslFlag: 0 | ||
}], | ||
}], // optionally set hosts | ||
osxBin: 'your_bin_dir', // optionally override the default bin directory for the OSX binary | ||
@@ -34,4 +34,3 @@ linux32Bin: 'your_bin_dir', // optionally override the default bin directory for the Linux 32 bit binary | ||
win32Bin: 'your_bin_dir', // optionally override the default bin directory for the win32 binary | ||
tunnelIdentifier: 'my_tunnel', // optionally set the -tunnelIdentifier option | ||
skipCheck: true, // optionally set the -skipCheck option | ||
localIdentifier: 'my_tunnel', // optionally set the -localIdentifier option | ||
v: true, // optionally set the -v (verbose) option | ||
@@ -42,3 +41,5 @@ proxyUser: PROXY_USER, // optionally set the -proxyUser option | ||
proxyHost: PROXY_HOST, // optionally set the -proxyHost option | ||
force: false // optionally set the -force option | ||
force: false, // optionally set the -force option | ||
forcelocal: false, // optionally set the -forcelocal option | ||
onlyAutomate: false, // optionally set the -onlyAutomate option | ||
}); | ||
@@ -45,0 +46,0 @@ |
@@ -35,17 +35,15 @@ var util = require('util'), | ||
var hosts = ''; | ||
options.hosts.forEach(function (host) { | ||
if (hosts.length > 0) { | ||
hosts += ','; | ||
} | ||
hosts += host.name + ',' + host.port + ',' + host.sslFlag; | ||
}); | ||
params.push(hosts); | ||
if (options.tunnelIdentifier) { | ||
params.push('-tunnelIdentifier', options.tunnelIdentifier); | ||
if (options.hosts) { | ||
var hosts = ''; | ||
options.hosts.forEach(function (host) { | ||
if (hosts.length > 0) { | ||
hosts += ','; | ||
} | ||
hosts += host.name + ',' + host.port + ',' + host.sslFlag; | ||
}); | ||
params.push(hosts); | ||
} | ||
if (options.skipCheck) { | ||
params.push('-skipCheck'); | ||
if (options.localIdentifier) { | ||
params.push('-localIdentifier', options.localIdentifier); | ||
} | ||
@@ -61,2 +59,10 @@ | ||
if (options.forcelocal) { | ||
params.push('-forcelocal'); | ||
} | ||
if (options.onlyAutomate) { | ||
params.push('-onlyAutomate'); | ||
} | ||
if (options.proxyHost) { | ||
@@ -63,0 +69,0 @@ params.push('-proxyHost', options.proxyHost); |
@@ -257,2 +257,28 @@ var expect = require('expect.js'), | ||
it('should support no hosts', function (done) { | ||
spawnSpy.reset(); | ||
var browserStackTunnel = new bs.BrowserStackTunnel({ | ||
key: KEY, | ||
win32Bin: WIN32_BINARY_DIR | ||
}); | ||
browserStackTunnel.start(function (error) { | ||
if (error) { | ||
expect().fail(function () { return error; }); | ||
} else if (browserStackTunnel.state === 'started') { | ||
sinon.assert.calledOnce(spawnSpy); | ||
sinon.assert.calledWithExactly( | ||
spawnSpy, | ||
WIN32_BINARY_FILE, [ | ||
KEY, | ||
] | ||
); | ||
done(); | ||
} | ||
}); | ||
setTimeout(function () { | ||
process.emit('mock:child_process:stdout:data', 'monkey----- Press Ctrl-C to exit ----monkey'); | ||
}, 100); | ||
}); | ||
it('should use the specified binary directory', function (done) { | ||
@@ -266,3 +292,3 @@ spawnSpy.reset(); | ||
sslFlag: SSL_FLAG, | ||
tunnelIdentifier: 'my_tunnel' | ||
localIdentifier: 'my_tunnel' | ||
}], | ||
@@ -292,3 +318,3 @@ win32Bin: WIN32_BINARY_DIR | ||
it('should support the tunnelIdentifier option', function (done) { | ||
it('should support the localIdentifier option', function (done) { | ||
spawnSpy.reset(); | ||
@@ -302,3 +328,3 @@ var browserStackTunnel = new bs.BrowserStackTunnel({ | ||
}], | ||
tunnelIdentifier: 'my_tunnel', | ||
localIdentifier: 'my_tunnel', | ||
win32Bin: WIN32_BINARY_DIR | ||
@@ -316,3 +342,3 @@ }); | ||
HOST_NAME + ',' + PORT + ',' + SSL_FLAG, | ||
'-tunnelIdentifier', | ||
'-localIdentifier', | ||
'my_tunnel' | ||
@@ -330,3 +356,3 @@ ] | ||
it('should support the skipCheck option', function (done) { | ||
it('should support the v (verbose) option', function (done) { | ||
spawnSpy.reset(); | ||
@@ -340,3 +366,3 @@ var browserStackTunnel = new bs.BrowserStackTunnel({ | ||
}], | ||
skipCheck: true, | ||
v: true, | ||
win32Bin: WIN32_BINARY_DIR | ||
@@ -354,3 +380,3 @@ }); | ||
HOST_NAME + ',' + PORT + ',' + SSL_FLAG, | ||
'-skipCheck' | ||
'-v' | ||
] | ||
@@ -367,3 +393,3 @@ ); | ||
it('should support the v (verbose) option', function (done) { | ||
it('should support the force option', function (done) { | ||
spawnSpy.reset(); | ||
@@ -377,3 +403,3 @@ var browserStackTunnel = new bs.BrowserStackTunnel({ | ||
}], | ||
v: true, | ||
force: true, | ||
win32Bin: WIN32_BINARY_DIR | ||
@@ -391,3 +417,3 @@ }); | ||
HOST_NAME + ',' + PORT + ',' + SSL_FLAG, | ||
'-v' | ||
'-force' | ||
] | ||
@@ -404,3 +430,3 @@ ); | ||
it('should support the force option', function (done) { | ||
it('should support the forcelocal option', function (done) { | ||
spawnSpy.reset(); | ||
@@ -414,3 +440,3 @@ var browserStackTunnel = new bs.BrowserStackTunnel({ | ||
}], | ||
force: true, | ||
forcelocal: true, | ||
win32Bin: WIN32_BINARY_DIR | ||
@@ -428,3 +454,3 @@ }); | ||
HOST_NAME + ',' + PORT + ',' + SSL_FLAG, | ||
'-force' | ||
'-forcelocal' | ||
] | ||
@@ -441,3 +467,3 @@ ); | ||
it('should support the skipCheck option', function (done) { | ||
it('should support the onlyAutomate option', function (done) { | ||
spawnSpy.reset(); | ||
@@ -451,3 +477,3 @@ var browserStackTunnel = new bs.BrowserStackTunnel({ | ||
}], | ||
skipCheck: true, | ||
onlyAutomate: true, | ||
win32Bin: WIN32_BINARY_DIR | ||
@@ -465,3 +491,3 @@ }); | ||
HOST_NAME + ',' + PORT + ',' + SSL_FLAG, | ||
'-skipCheck' | ||
'-onlyAutomate' | ||
] | ||
@@ -591,3 +617,3 @@ ); | ||
sslFlag: SSL_FLAG, | ||
tunnelIdentifier: 'my_tunnel' | ||
localIdentifier: 'my_tunnel' | ||
}], | ||
@@ -687,3 +713,3 @@ win32Bin: WIN32_BINARY_DIR | ||
sslFlag: SSL_FLAG, | ||
tunnelIdentifier: 'my_tunnel' | ||
localIdentifier: 'my_tunnel' | ||
}], | ||
@@ -783,3 +809,3 @@ osxBin: OSX_BINARY_DIR | ||
sslFlag: SSL_FLAG, | ||
tunnelIdentifier: 'my_tunnel' | ||
localIdentifier: 'my_tunnel' | ||
}], | ||
@@ -879,3 +905,3 @@ linux64Bin: LINUX_64_BINARY_DIR | ||
sslFlag: SSL_FLAG, | ||
tunnelIdentifier: 'my_tunnel' | ||
localIdentifier: 'my_tunnel' | ||
}], | ||
@@ -882,0 +908,0 @@ linux32Bin: LINUX_32_BINARY_DIR |
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
49329
1321
74