Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
fix: Avoid setting tunnelIdentifier if startTunnel is false
Browse files Browse the repository at this point in the history
If a tunnelIdentifier or localIdentifier is set in config, it is used as the tunnelIdentifier
when creating a new browser-worker. If not set and startTunnel is true, we generate a random tunnelIdentifier.
  • Loading branch information
shirish87 committed Nov 19, 2015
1 parent a69c2ed commit fe61baa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var createBrowserStackTunnel = function (logger, config, emitter) {
var bsBinaryBasePath = process.env.BROWSER_STACK_BINARY_BASE_PATH || bsConfig.binaryBasePath || null
var bsRunConfig = {
key: process.env.BROWSER_STACK_ACCESS_KEY || bsConfig.accessKey,
localIdentifier: bsConfig.localIdentifier || bsConfig.tunnelIdentifier || 'karma' + Math.random(),
localIdentifier: bsConfig.localIdentifier || bsConfig.tunnelIdentifier,
jarFile: process.env.BROWSER_STACK_TUNNEL_JAR || bsConfig.jarFile,
hosts: [{
name: config.hostname,
Expand All @@ -19,12 +19,14 @@ var createBrowserStackTunnel = function (logger, config, emitter) {
}]
}

bsConfig.tunnelIdentifier = bsRunConfig.localIdentifier

if (bsConfig.startTunnel === false) {
bsConfig.tunnelIdentifier = bsRunConfig.localIdentifier
return q()
}

bsRunConfig.localIdentifier = bsRunConfig.localIdentifier || 'karma' + Math.random()
bsConfig.tunnelIdentifier = bsRunConfig.localIdentifier

if (bsBinaryBasePath) {
switch (os.platform()) {
case 'linux':
Expand Down

0 comments on commit fe61baa

Please sign in to comment.