Skip to content

Commit

Permalink
Fix at printing
Browse files Browse the repository at this point in the history
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)',
  • Loading branch information
Raynos authored and James Halliday committed Sep 20, 2013
1 parent 9ea37cc commit fae125e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ Test.prototype._assert = function assert (ok, opts) {

var s = m[1].split(/\s+/);
var filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]);
if (!filem) continue;
if (!filem) {
filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]);

if (!filem) continue;
}

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

Expand Down

0 comments on commit fae125e

Please sign in to comment.