Skip to content

Commit 3b77abe

Browse files
committed
=BG= windows specific bug: plugin file paths with \\ instead of \
1 parent fe367a0 commit 3b77abe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/test/karma.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,15 @@ function getKarmaReporterPluginPath(reporterName) {
4949
require(reporterPath);
5050
}
5151
catch (ex) {
52-
throw 'Get Karma Reporter Plugin Path: Attempt to require reporter from path ' + reporterPath + ' with no success.';
52+
throw 'Get Karma Reporter Plugin Path: Attempt to require reporter from path ' +
53+
reporterPath + ' with no success.';
54+
}
55+
reporterPath = path.normalize(reporterPath);
56+
//quirk: nodejs identifies all windows (both win32 and win64) as win32
57+
if (process.platform === 'win32') {
58+
//replace any single backslash characters in file paths with
59+
//double backslash on windows; neither path.normalize nor path.resolve do this
60+
reporterPath = reporterPath.replace( /\\/g , '\\\\' );
5361
}
5462
return reporterPath;
5563
}

0 commit comments

Comments
 (0)