From 1f79e4f4b499040bf927b5465c3ac286aa859d43 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 6 Nov 2014 14:30:10 +1000 Subject: [PATCH] test: use common.PIPE for emptyTxt path Work-around for long paths exceeding limits for UNIX socket binds, emptyTxt would otherwise be burried deep in the fixtures directory. PR-URL: https://github.com/node-forward/node/pull/51 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- test/simple/test-net-pipe-connect-errors.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/simple/test-net-pipe-connect-errors.js b/test/simple/test-net-pipe-connect-errors.js index 8200a16cf0b..7db7108c6a4 100644 --- a/test/simple/test-net-pipe-connect-errors.js +++ b/test/simple/test-net-pipe-connect-errors.js @@ -31,7 +31,18 @@ var accessErrorFired = false; // Test if ENOTSOCK is fired when trying to connect to a file which is not // a socket. -var emptyTxt = path.join(common.fixturesDir, 'empty.txt'); +var emptyTxt = common.PIPE + '.txt'; +function cleanup() { + try { + fs.unlinkSync(emptyTxt); + } catch (e) { + if (e.code != 'ENOENT') + throw e; + } +} +process.on('exit', cleanup); +cleanup(); +fs.writeFileSync(emptyTxt, ''); var notSocketClient = net.createConnection(emptyTxt, function() { assert.ok(false); });