added warning for when trying to use casper in a node env
Showing
1 changed file
with
6 additions
and
1 deletions
... | @@ -28,9 +28,14 @@ | ... | @@ -28,9 +28,14 @@ |
28 | * | 28 | * |
29 | */ | 29 | */ |
30 | 30 | ||
31 | /*global console, phantom, require:true*/ | 31 | /*global process, console, phantom, require:true*/ |
32 | /*jshint maxstatements:30, maxcomplexity:10*/ | 32 | /*jshint maxstatements:30, maxcomplexity:10*/ |
33 | 33 | ||
34 | // node check | ||
35 | if (process && process.title === "node") { | ||
36 | console.error('CasperJS cannot be executed within a nodejs environment'); | ||
37 | } | ||
38 | |||
34 | // phantom check | 39 | // phantom check |
35 | if (!phantom) { | 40 | if (!phantom) { |
36 | console.error('CasperJS needs to be executed in a PhantomJS environment http://phantomjs.org/'); | 41 | console.error('CasperJS needs to be executed in a PhantomJS environment http://phantomjs.org/'); | ... | ... |
-
Please register or sign in to post a comment