Skip to content

Commit

Permalink
Remove main stack trace from default reporter (closes caolan#23)
Browse files Browse the repository at this point in the history
I've come to the understanding that mot of the stack trace are
irrelevant, thus this commit will remove all of it except the file and
line number of the second entry in the stack trace which empirically
matches the probable invocation in the test code
  • Loading branch information
azatoth committed Mar 20, 2011
1 parent 121df84 commit ed9fa3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/reporters/default.js
Expand Up @@ -22,6 +22,11 @@ var nodeunit = require('../nodeunit'),

exports.info = "Default tests reporter";

Error.prepareStackTrace = function(error, structuredStackTrace) {
// our invocation will be at the second level of the stack trace
var our = structuredStackTrace[1];
return "\nat " + our.getFileName() + " line " + our.getLineNumber();
}

/**
* Run all tests within each module, reporting the results to the command-line.
Expand Down

0 comments on commit ed9fa3a

Please sign in to comment.