Skip to content

Commit fae125e

Browse files
RaynosJames Halliday
authored and
James Halliday
committedSep 20, 2013
Fix at printing
Some stack traces have '[as X]' in them. So now the regexp checks the s[1] and the s[3] which means it captures the right line (my code) instead of printing tape's depth at Test.user [as _cb] (/home/raynos/Documents/colingo-payments/test/integration/create-account.js:13:12)', at Test.run (/home/raynos/Documents/colingo-payments/node_modules/tape/lib/test.js:53:14)',
1 parent 9ea37cc commit fae125e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

Diff for: ‎lib/test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ Test.prototype._assert = function assert (ok, opts) {
140140

141141
var s = m[1].split(/\s+/);
142142
var filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]);
143-
if (!filem) continue;
143+
if (!filem) {
144+
filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]);
145+
146+
if (!filem) continue;
147+
}
144148

145149
if (filem[1].slice(0, dir.length) === dir) continue;
146150

0 commit comments

Comments
 (0)
Please sign in to comment.