Created
March 5, 2012 22:52
-
-
Save DTrejo/1981749 to your computer and use it in GitHub Desktop.
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
/* | |
# set a password, leave all else as default | |
echo "requirepass password" >> tests/auth_error.conf | |
# start redis server | |
redis-server tests/auth_error.conf | |
# run this script | |
node tests/auth_error.js | |
*/ | |
var redis = require('../index'); | |
var assert = require('assert'); | |
// redis.debug_mode = true; | |
var options = { no_ready_check: false }; | |
var client = redis.createClient(6379, '0.0.0.0', options); | |
console.log('This is printed out'); | |
// without this, can't talk to redis and an error is thrown. | |
// client.auth('password'); | |
client.on('ready', function(){ | |
console.log('==Test succeeded=='); | |
console.log('This would not get printed if the bug existed'); | |
client.auth('password', function() { | |
process.exit(0); | |
}); | |
}); | |
client.on('error', function(e) { | |
console.log('==Test failed=='); | |
console.log(e); | |
process.exit(1); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment