Skip to content

Commit e646b4e

Browse files
author
Hans Kristian Flaatten
committed
Skip SOCKET test if Redis is not listening on a socket
1 parent d34dcc8 commit e646b4e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ tests.IPV6 = function () {
166166
}
167167

168168
tests.UNIX_SOCKET = function () {
169+
try {
170+
var stat = require('fs').accessSync('/tmp/redis.sock');
171+
} catch(err) {
172+
if (err.code === 'ENOENT') {
173+
console.log("Skipping SOCKET since none exists");
174+
return run_next_test();
175+
}
176+
}
177+
169178
var unixClient = redis.createClient('/tmp/redis.sock', { parser: parser });
170179

171180
// if this fails, check the permission of unix socket.

0 commit comments

Comments
 (0)