From f90e487aad2d787b6d725186e37bf352110dd97d Mon Sep 17 00:00:00 2001 From: Norman Date: Sat, 14 Oct 2017 14:01:49 -0700 Subject: [PATCH] normalize path separators in stacks --- test/common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/common.js b/test/common.js index 4ded4e5f..9e4a0391 100644 --- a/test/common.js +++ b/test/common.js @@ -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(/, \:\$LINE:\$COL\)$/, ')'); return withoutNestedLineNumbers; }