Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle stacks better

  • Loading branch information...
commit aa6bf2c969e554637f17e9e29f6e9ec609f8dd0c 1 parent a9ae08e
@isaacs authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/assert.js
  2. +1 −1  lib/test.js
View
4 lib/assert.js
@@ -325,7 +325,7 @@ function diff (f, w, p) {
f = f.substr(pos, 40)
return "FOUND: "+f+"\n"
+ "WANTED: "+w+"\n"
- + (new Array(Math.min(20, pos) + 1).join(" "))
+ + (new Array(Math.min(20, pos) + 9).join(" "))
+ "^ (at position = "+p+")"
}
@@ -340,7 +340,7 @@ function getCaller (er) {
var file = s[1]
, line = +s[2]
, col = +s[3]
- if (file === __filename) continue
+ if (file.indexOf(__dirname) === 0) continue
else break
}
var res = {}
View
2  lib/test.js
@@ -33,7 +33,7 @@ Test.prototype.clear = function () {
// this gets called if a test throws ever
Test.prototype.threw = function (ex) {
//console.error("threw!", ex.stack)
- this.fail(ex.name + ": " + ex.message, { error: ex })
+ this.fail(ex.name + ": " + ex.message, { error: ex, thrown: true })
// may emit further failing tests if the plan is not completed
//console.error("end, because it threw")
this.end()
Please sign in to comment.
Something went wrong with that request. Please try again.