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) {
this._test = undefined;
this.__defineGetter__('test', function() {
if (!phantom.casperTest) {
this.emit('tester.called');
return;
this.die('casper.test property is only available using the `casperjs test` command');
}
if (!utils.isObject(this._test)) {
this._test = tester.create(this);
......@@ -166,10 +165,6 @@ var Casper = function Casper(options) {
return this._test;
});
this.once('tester.called', function() {
this.warn('please use `casperjs test` command');
});
// init phantomjs error handler
this.initErrorHandler();
......