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) {
// casper events
this.casper.on('error', function onCasperError(msg, backtrace) {
var type = 'error', message = msg, match = /^(\w+)Error: (.*)/.exec(msg);
if (match) {
type = match[1].toLowerCase();
message = match[2];
}
if (type !== 'assertion') {
return this.test.uncaughtError(msg, this.currentTestFile, null, backtrace);
if (/^AssertionError/.test(msg)) {
return;
}
this.test.fail(message, {
type: type,
this.test.fail(msg, {
type: "error",
doThrow: false,
values: {
stack: backtrace
......