Skip to content

Commit

Permalink
Check added stack trace parts for filename match
Browse files Browse the repository at this point in the history
  • Loading branch information
fongandrew committed Sep 11, 2017
1 parent 0bb42ee commit 698f197
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,14 @@ Test.prototype._assert = function assert (ok, opts) {
}

var s = m[1].split(/\s+/);
var filem = /((?:\/|[A-Z]:\\)[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]);
if (!filem) {
filem = /((?:\/|[A-Z]:\\)[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[2]);

if (!filem) {
filem = /((?:\/|[A-Z]:\\)[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]);

if (!filem) {
continue;
}
}
var filemRe = /((?:\/|[A-Z]:\\)[^:\s]+:(\d+)(?::(\d+))?)/;
var filem;
var sIndex;
for (sIndex in s.slice(0, 4)) {
filem = filemRe.exec(s[sIndex]);
if (filem) break;
}
if (! filem) continue;

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

0 comments on commit 698f197

Please sign in to comment.