Skip to content

Commit

Permalink
added line nb information on test failure error message
Browse files Browse the repository at this point in the history
  • Loading branch information
n1k0 committed Jan 11, 2012
1 parent 0b12899 commit 9dd655b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/tester.js
Expand Up @@ -412,13 +412,15 @@ var Tester = function(casper, options) {
}
casper.echo(f("\nDetails for the %d failed test%s:\n", failures.length, failures.length > 1 ? "s" : ""), "PARAMETER");
failures.forEach(function(failure) {
casper.echo(f('In %s:', failure.file));
var message;
var message, line;
if (utils.isType(failure.message, "object") && failure.message.stack) {
line = failure.message.line ? failure.message.line : 0;
message = failure.message.stack;
} else {
line = 0;
message = failure.message;
}
casper.echo(f('In %s:%d', failure.file, line));
casper.echo(f(' %s', message), "COMMENT");
});
};
Expand Down Expand Up @@ -511,8 +513,6 @@ var Tester = function(casper, options) {
try {
this.exec(testFile);
} catch (e) {
// TODO: better formatting of aborted failing suite
// TODO: add exception trace (?)
this.fail(e);
this.done();
}
Expand Down

0 comments on commit 9dd655b

Please sign in to comment.