Commit 4409d91f 4409d91f3a5b30ba69dad7d3eebd7390c075e7a4 by Nicolas Perriault

simpler casper error handling in tests

1 parent e7eaeea1
...@@ -143,16 +143,11 @@ var Tester = function Tester(casper, options) { ...@@ -143,16 +143,11 @@ var Tester = function Tester(casper, options) {
143 143
144 // casper events 144 // casper events
145 this.casper.on('error', function onCasperError(msg, backtrace) { 145 this.casper.on('error', function onCasperError(msg, backtrace) {
146 var type = 'error', message = msg, match = /^(\w+)Error: (.*)/.exec(msg); 146 if (/^AssertionError/.test(msg)) {
147 if (match) { 147 return;
148 type = match[1].toLowerCase();
149 message = match[2];
150 }
151 if (type !== 'assertion') {
152 return this.test.uncaughtError(msg, this.currentTestFile, null, backtrace);
153 } 148 }
154 this.test.fail(message, { 149 this.test.fail(msg, {
155 type: type, 150 type: "error",
156 doThrow: false, 151 doThrow: false,
157 values: { 152 values: {
158 stack: backtrace 153 stack: backtrace
......