browserstacktunnel-wrapper
Advanced tools
Comparing version 0.0.1 to 1.0.0
{ | ||
"name": "browserstacktunnel-wrapper", | ||
"description": "A Node.js wrapper for the BrowserStack java tunnel client ", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/pghalliday/node-BrowserStackTunnel.git", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -27,7 +27,10 @@ node-BrowserStackTunnel | ||
var browserStackTunnel = new BrowserStackTunnel(YOUR_KEY, [{ | ||
name: 'localhost', | ||
port: 8080, | ||
sslFlag: 0 | ||
}]); | ||
var browserStackTunnel = new BrowserStackTunnel({ | ||
key: YOUR_KEY, | ||
hosts: [{ | ||
name: 'localhost', | ||
port: 8080, | ||
sslFlag: 0 | ||
}] | ||
}); | ||
@@ -34,0 +37,0 @@ browserStackTunnel.start(function(error) { |
var util = require('util'), | ||
ChildDaemon = require('child-daemon'); | ||
function BrowserStackTunnel(key, hosts, jarFile) { | ||
jarFile = jarFile || __dirname + '/../bin/BrowserStackTunnel.jar'; | ||
function BrowserStackTunnel(options) { | ||
options.jarFile = options.jarFile || __dirname + '/../bin/BrowserStackTunnel.jar'; | ||
var params = ''; | ||
hosts.forEach(function(host) { | ||
options.hosts.forEach(function(host) { | ||
if (params.length > 0) { | ||
@@ -16,3 +16,3 @@ params += ','; | ||
'java', | ||
['-jar', jarFile, key, params], | ||
['-jar', options.jarFile, options.key, params], | ||
new RegExp('Press Ctrl-C to exit') | ||
@@ -19,0 +19,0 @@ ); |
@@ -27,7 +27,10 @@ var expect = require('expect.js'), | ||
this.timeout(10000); | ||
var browserStackTunnel = new BrowserStackTunnel(CONFIG.key, [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}]); | ||
var browserStackTunnel = new BrowserStackTunnel({ | ||
key: CONFIG.key, | ||
hosts: [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}] | ||
}); | ||
browserStackTunnel.start(function(error) { | ||
@@ -48,7 +51,11 @@ if (error) { | ||
it('should error if an invalid jar file is specified', function(done) { | ||
var browserStackTunnel = new BrowserStackTunnel(CONFIG.key, [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}], INVALID_JAR_FILE); | ||
var browserStackTunnel = new BrowserStackTunnel({ | ||
key: CONFIG.key, | ||
hosts: [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}], | ||
jarFile: INVALID_JAR_FILE | ||
}); | ||
browserStackTunnel.start(function(error) { | ||
@@ -61,7 +68,10 @@ expect(error.message).to.contain('child failed to start'); | ||
it('should error if stopped before started', function(done) { | ||
var browserStackTunnel = new BrowserStackTunnel(CONFIG.key, [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}]); | ||
var browserStackTunnel = new BrowserStackTunnel({ | ||
key: CONFIG.key, | ||
hosts: [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}] | ||
}); | ||
browserStackTunnel.stop(function(error) { | ||
@@ -75,7 +85,10 @@ expect(error.message).to.be('child not started'); | ||
this.timeout(5000); | ||
var browserStackTunnel = new BrowserStackTunnel(CONFIG.key, [{ | ||
name: HOST_NAME, | ||
port: INVALID_PORT, | ||
sslFlag: SSL_FLAG | ||
}]); | ||
var browserStackTunnel = new BrowserStackTunnel({ | ||
key: CONFIG.key, | ||
hosts: [{ | ||
name: HOST_NAME, | ||
port: INVALID_PORT, | ||
sslFlag: SSL_FLAG | ||
}] | ||
}); | ||
browserStackTunnel.start(function(error) { | ||
@@ -90,7 +103,10 @@ expect(error.message).to.contain('child failed to start'); | ||
this.timeout(5000); | ||
var browserStackTunnel = new BrowserStackTunnel(CONFIG.key, [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}]); | ||
var browserStackTunnel = new BrowserStackTunnel({ | ||
key: CONFIG.key, | ||
hosts: [{ | ||
name: HOST_NAME, | ||
port: PORT, | ||
sslFlag: SSL_FLAG | ||
}] | ||
}); | ||
browserStackTunnel.start(function(error) { | ||
@@ -97,0 +113,0 @@ if (error) { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1066569
216
0
79