karma-phantomjs-launcher
Launcher for PhantomJS.
Installation
The easiest way is to keep karma-phantomjs-launcher
as a devDependency in your package.json
,
by running
$ npm install --save-dev karma-phantomjs-launcher
Configuration
// karma.conf.jsmodule { config}
The options
attribute allows you to initialize properties on
the phantomjs page
object, so
options: windowName: 'my-window' settings: webSecurityEnabled: false
is equivalent to:
var webPage = var page = webPage pagewindowName = 'my-window'pagesettingswebSecurityEnabled = false
You can pass list of browsers as a CLI argument too:
$ karma start --browsers PhantomJS_custom
If you set the debug
option to true
, you will be instructed to launch a web browser to
bring up the debugger. Note that you will want to put debugger;
statements in your JavaScript
to hit breakpoints. You should be able to put breakpoints in both your test code and your client
code. Note that the debug
option automatically adds the --remote-debugger-port=9000
and
--remote-debugger-autorun=yes
switches to PhantomJS.
For more information on Karma see the homepage.