Skip to content

Commit

Permalink
feat: use phantomjs npm module
Browse files Browse the repository at this point in the history
When the phantomjs npm module is installed it includes the
phantomjs binary native to the OS. Using this binary allows
Karma to launch tests via PhantomJS "out of the box," without
the need for users to install PhantomJS manually or worry
about configuring the path to their PhantomJS executable.

Users are still free to install their own copy of PhantomJS
and override the PHANTOMJS_BIN environment variable.

Closes karma-runner#1
  • Loading branch information
jmdobry committed Mar 31, 2013
1 parent 55196fa commit a7ff7a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.idea/*
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ PhantomJSBrowser.prototype = {
name: 'PhantomJS',

DEFAULT_CMD: {
linux: 'phantomjs',
darwin: '/usr/local/bin/phantomjs',
win32: process.env.ProgramFiles + '\\PhantomJS\\phantomjs.exe'
linux: require('phantomjs').path,
darwin: require('phantomjs').path,
win32: require('phantomjs').path
},
ENV_CMD: 'PHANTOMJS_BIN'
};
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"phantomjs"
],
"author": "Vojta Jina <[email protected]>",
"dependencies": {},
"dependencies": {
"phantomjs": "~1.8"
},
"peerDependencies": {
"karma": "~0.9"
},
Expand Down

0 comments on commit a7ff7a2

Please sign in to comment.