test: use relative path in pipePrefix

Modified pipePrefix to use relative path on windows,
previously tests failed when the full path was 120+ characters

PR-URL: https://github.com/nodejs/node/pull/15988
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Randal Hanford 2017-10-06 10:51:12 -07:00 committed by Joyee Cheung
parent 4826ac537f
commit 971aad1b13

View File

@ -258,7 +258,8 @@ Object.defineProperty(exports, 'hasFipsCrypto', {
});
{
const pipePrefix = exports.isWindows ? '\\\\.\\pipe\\' : `${exports.tmpDir}/`;
const localRelative = path.relative(process.cwd(), `${exports.tmpDir}/`);
const pipePrefix = exports.isWindows ? '\\\\.\\pipe\\' : localRelative;
const pipeName = `node-test.${process.pid}.sock`;
exports.PIPE = pipePrefix + pipeName;
}