From 9fb7aee7471119d4d33982f5acca6eadde75745c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 29 Oct 2014 17:21:12 +0100 Subject: [PATCH] test: unlink custom unix socket before test 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: https://github.com/node-forward/node/pull/40 Reviewed-By: Rod Vagg --- test/common.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/common.js b/test/common.js index 17bfdc071c2812..bbc772ef581696 100644 --- a/test/common.js +++ b/test/common.js @@ -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;