Commit 9dd655b4 9dd655b4a5860d0d59da6405b11d781c8644069c by Nicolas Perriault

added line nb information on test failure error message

1 parent 0b128997
...@@ -412,13 +412,15 @@ var Tester = function(casper, options) { ...@@ -412,13 +412,15 @@ var Tester = function(casper, options) {
412 } 412 }
413 casper.echo(f("\nDetails for the %d failed test%s:\n", failures.length, failures.length > 1 ? "s" : ""), "PARAMETER"); 413 casper.echo(f("\nDetails for the %d failed test%s:\n", failures.length, failures.length > 1 ? "s" : ""), "PARAMETER");
414 failures.forEach(function(failure) { 414 failures.forEach(function(failure) {
415 casper.echo(f('In %s:', failure.file)); 415 var message, line;
416 var message;
417 if (utils.isType(failure.message, "object") && failure.message.stack) { 416 if (utils.isType(failure.message, "object") && failure.message.stack) {
417 line = failure.message.line ? failure.message.line : 0;
418 message = failure.message.stack; 418 message = failure.message.stack;
419 } else { 419 } else {
420 line = 0;
420 message = failure.message; 421 message = failure.message;
421 } 422 }
423 casper.echo(f('In %s:%d', failure.file, line));
422 casper.echo(f(' %s', message), "COMMENT"); 424 casper.echo(f(' %s', message), "COMMENT");
423 }); 425 });
424 }; 426 };
...@@ -511,8 +513,6 @@ var Tester = function(casper, options) { ...@@ -511,8 +513,6 @@ var Tester = function(casper, options) {
511 try { 513 try {
512 this.exec(testFile); 514 this.exec(testFile);
513 } catch (e) { 515 } catch (e) {
514 // TODO: better formatting of aborted failing suite
515 // TODO: add exception trace (?)
516 this.fail(e); 516 this.fail(e);
517 this.done(); 517 this.done();
518 } 518 }
......