Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
fix: do not duplicate cmd-line flags on repeated PhantomJS runs
Browse files Browse the repository at this point in the history
Karma may retry running the same browser instance multiple times in case
something goes wrong with the first run, i.e if the browser process
terminates unexpectedly for some reason. In such cases PhantomJS launcher
would re-add all of its PhantomJS command-line options to the initially
used option list instead of reusing the same one.
  • Loading branch information
jurko-gospodnetic committed Dec 24, 2015
1 parent 83e482a commit 76228f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var PhantomJSBrowser = function (baseBrowserDecorator, config, args, logger) {
baseBrowserDecorator(this)

var options = args && args.options || config && config.options || {}
var flags = args && args.flags || config && config.flags || []
var providedFlags = args && args.flags || config && config.flags || []

this._start = function (url) {
// create the js file that will open karma
Expand All @@ -48,6 +48,7 @@ var PhantomJSBrowser = function (baseBrowserDecorator, config, args, logger) {
}
})

var flags = _.clone(providedFlags);
if (args.debug) {
flags = flags.concat('--remote-debugger-port=9000')
flags = flags.concat('--remote-debugger-autorun=yes')
Expand Down

0 comments on commit 76228f1

Please sign in to comment.