Commit 326185dd 326185dd69f34bf232b7f6aa7b68950d6911a049 by Nathan Black

undo double error event emitting from modules/casper.js@76b7f73 and the extra c…

…oupling in the onError handler
1 parent 5d9f0ea0
...@@ -180,9 +180,6 @@ var Casper = function Casper(options) { ...@@ -180,9 +180,6 @@ var Casper = function Casper(options) {
180 this.initErrorHandler(); 180 this.initErrorHandler();
181 181
182 this.on('error', function(msg, backtrace) { 182 this.on('error', function(msg, backtrace) {
183 if (/^(Assertion|Termination|TimedOut)Error/.test(msg)) {
184 return;
185 }
186 var c = this.getColorizer(); 183 var c = this.getColorizer();
187 var match = /^(.*): __mod_error(.*):: (.*)/.exec(msg); 184 var match = /^(.*): __mod_error(.*):: (.*)/.exec(msg);
188 var notices = []; 185 var notices = [];
...@@ -387,7 +384,6 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) { ...@@ -387,7 +384,6 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) {
387 } 384 }
388 } catch (error) { 385 } catch (error) {
389 self.emit('complete.error', error); 386 self.emit('complete.error', error);
390 this.emit('error', error);
391 } 387 }
392 }; 388 };
393 389
...@@ -1535,7 +1531,6 @@ Casper.prototype.runStep = function runStep(step) { ...@@ -1535,7 +1531,6 @@ Casper.prototype.runStep = function runStep(step) {
1535 } 1531 }
1536 } catch (err) { 1532 } catch (err) {
1537 this.emit('step.error', err); 1533 this.emit('step.error', err);
1538 this.emit('error', err);
1539 } 1534 }
1540 if (!skipLog) { 1535 if (!skipLog) {
1541 this.emit('step.complete', stepResult); 1536 this.emit('step.complete', stepResult);
......
...@@ -276,12 +276,12 @@ class TestCommandOutputTest(CasperExecTestBase): ...@@ -276,12 +276,12 @@ class TestCommandOutputTest(CasperExecTestBase):
276 script_path, 276 script_path,
277 '# step throws', 277 '# step throws',
278 'FAIL Error: oops!', 278 'FAIL Error: oops!',
279 '# type: error', 279 '# type: uncaughtError',
280 '# file: %s:5' % script_path, 280 '# file: %s:5' % script_path,
281 '# error: oops!', 281 '# error: oops!',
282 'FAIL 2 tests executed', # this is another bug 282 'FAIL 1 test executed',
283 '0 passed', 283 '0 passed',
284 '2 failed', 284 '1 failed',
285 '0 dubious', 285 '0 dubious',
286 '0 skipped', 286 '0 skipped',
287 ], failing=True) 287 ], failing=True)
......