Skip to content

Commit

Permalink
test: unlink custom unix socket before test
Browse files Browse the repository at this point in the history
Unlink NODE_COMMON_PIPE before running the test if set in the
environment.  The test runner won't do it for us like it does
for files in test/tmp.

PR-URL: node-forward/node#40
Reviewed-By: Rod Vagg <rod@vagg.org>
  • Loading branch information
bnoordhuis committed Nov 5, 2014
1 parent bf23328 commit 9fb7aee
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ if (process.platform === 'win32') {
} else {
exports.PIPE = exports.tmpDir + '/test.sock';
}
if (process.env.NODE_COMMON_PIPE)

if (process.env.NODE_COMMON_PIPE) {
exports.PIPE = process.env.NODE_COMMON_PIPE;
// Remove manually, the test runner won't do it
// for us like it does for files in test/tmp.
try {
fs.unlinkSync(exports.PIPE);
} catch (e) {
// Ignore.
}
}

if (!fs.existsSync(exports.opensslCli))
exports.opensslCli = false;

Expand Down

0 comments on commit 9fb7aee

Please sign in to comment.