Skip to content

Commit

Permalink
Merge pull request #402 from nhamer/stack_strip
Browse files Browse the repository at this point in the history
normalize path separators in stripFullStack
  • Loading branch information
ljharb committed Oct 15, 2017
2 parents b66f8f8 + f90e487 commit 13173a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ module.exports.stripFullStack = function (output) {
var stripChangingData = function (line) {
var withoutTestDir = line.replace(__dirname, '$TEST');
var withoutPackageDir = withoutTestDir.replace(path.dirname(__dirname), '$TAPE');
var withoutLineNumbers = withoutPackageDir.replace(/:\d+:\d+/g, ':$LINE:$COL');
var withoutPathSep = withoutPackageDir.replace(new RegExp('\\' + path.sep, 'g'), '/');
var withoutLineNumbers = withoutPathSep.replace(/:\d+:\d+/g, ':$LINE:$COL');
var withoutNestedLineNumbers = withoutLineNumbers.replace(/, \<anonymous\>:\$LINE:\$COL\)$/, ')');
return withoutNestedLineNumbers;
}
Expand Down

0 comments on commit 13173a5

Please sign in to comment.