Commit ce066ab8 ce066ab87810a9763e324f72c5c1ce961b6c0d60 by Nicolas Perriault

exit when trying to use .test in a non-test env

1 parent df4a9c2f
...@@ -157,8 +157,7 @@ var Casper = function Casper(options) { ...@@ -157,8 +157,7 @@ var Casper = function Casper(options) {
157 this._test = undefined; 157 this._test = undefined;
158 this.__defineGetter__('test', function() { 158 this.__defineGetter__('test', function() {
159 if (!phantom.casperTest) { 159 if (!phantom.casperTest) {
160 this.emit('tester.called'); 160 this.die('casper.test property is only available using the `casperjs test` command');
161 return;
162 } 161 }
163 if (!utils.isObject(this._test)) { 162 if (!utils.isObject(this._test)) {
164 this._test = tester.create(this); 163 this._test = tester.create(this);
...@@ -166,10 +165,6 @@ var Casper = function Casper(options) { ...@@ -166,10 +165,6 @@ var Casper = function Casper(options) {
166 return this._test; 165 return this._test;
167 }); 166 });
168 167
169 this.once('tester.called', function() {
170 this.warn('please use `casperjs test` command');
171 });
172
173 // init phantomjs error handler 168 // init phantomjs error handler
174 this.initErrorHandler(); 169 this.initErrorHandler();
175 170
......