FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: don't remove empty.txt on win32 by rvagg · Pull Request #2 · nodejs/node · GitHub

/ node Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
21 changes: 11 additions & 10 deletions test/simple/test-net-pipe-connect-errors.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,20 @@ if (process.platform === 'win32') {
// use common.PIPE to ensure we stay within POSIX socket path length
// restrictions, even on CI
emptyTxt = common.PIPE + '.txt';
}

function cleanup() {
try {
fs.unlinkSync(emptyTxt);
} catch (e) {
if (e.code != 'ENOENT')
throw e;
function cleanup() {
try {
fs.unlinkSync(emptyTxt);
} catch (e) {
if (e.code != 'ENOENT')
throw e;
}
}
process.on('exit', cleanup);
cleanup();
fs.writeFileSync(emptyTxt, '');
}
process.on('exit', cleanup);
cleanup();
fs.writeFileSync(emptyTxt, '');

var notSocketClient = net.createConnection(emptyTxt, function() {
assert.ok(false);
});
Expand Down

Back | FazBrowse Home | New Git URL