Commit 9d8e2777 9d8e27776aeb44825d69ce699b25cf0c688b20c2 by Nicolas Perriault

added warning for when trying to use casper in a node env

1 parent c543ddab
...@@ -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/');
......