Skip to content

Commit 0e8eb66

Browse files
mcornacjasnell
authored andcommitted
test: fix path to module for repl test on Windows
Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: #3608 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 11d2050 commit 0e8eb66

File tree

1 file changed

+6
-2
lines changed
  • test/addons/repl-domain-abort

1 file changed

+6
-2
lines changed

test/addons/repl-domain-abort/test.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
'use strict';
2-
require('../../common');
2+
var common = require('../../common');
33
var assert = require('assert');
44
var repl = require('repl');
55
var stream = require('stream');
6+
var path = require('path');
67
var buildType = process.config.target_defaults.default_configuration;
7-
var buildPath = __dirname + '/build/' + buildType + '/binding';
8+
var buildPath = path.join(__dirname, 'build', buildType, 'binding');
9+
// On Windows, escape backslashes in the path before passing it to REPL.
10+
if (common.isWindows)
11+
buildPath = buildPath.replace(/\\/g, '/');
812
var cb_ran = false;
913

1014
process.on('exit', function() {

0 commit comments

Comments
 (0)