Skip to content

Commit

Permalink
fix: Correct cli argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jan 4, 2016
1 parent 7b5e522 commit e33946d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ var PhantomJSBrowser = function (baseBrowserDecorator, config, args, logger) {

fs.writeFileSync(captureFile, captureCode)

// PhantomJS takes its script file as the first cmd-line argument
var flags = [captureFile].concat(providedFlags)
// PhantomJS has the following convention for arguments
// phantomjs [switchs] [options] [script] [argument [argument [...]]]
// with options being equal to flags
var flags = providedFlags
if (args.debug) {
flags.push('--remote-debugger-port=9000')
flags.push('--remote-debugger-autorun=yes')
}

flags.push(captureFile)

// and start phantomjs
this._execCommand(this._getCommand(), flags)

Expand Down
9 changes: 8 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,19 @@ module.exports = function (config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
browsers: ['PhantomJS', 'PhantomJS_flags'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

customLaunchers: {
'PhantomJS_flags': {
base: 'PhantomJS',
flags: ['--load-images=false']
}
},

plugins: [
require('karma-jasmine'),
require('./index')
Expand Down

0 comments on commit e33946d

Please sign in to comment.