Skip to content

Commit 8a84482

Browse files
committedMay 7, 2016
test: update test for auth
1 parent 63806f9 commit 8a84482

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed
 

‎test/functional/auth.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,21 @@ describe('auth', function () {
7171
}
7272
});
7373
var redis = new Redis({ port: 17379, password: 'pass' });
74+
var pending = 2;
75+
function check() {
76+
if (!--pending) {
77+
redis.disconnect();
78+
server.disconnect();
79+
done();
80+
}
81+
}
7482
redis.on('error', function (error) {
7583
expect(error).to.have.property('message', 'ERR invalid password');
76-
redis.disconnect();
77-
server.disconnect();
78-
done();
84+
check();
85+
});
86+
redis.get('foo', function (err, res) {
87+
expect(err.message).to.eql('ERR invalid password');
88+
check();
7989
});
8090
});
8191

0 commit comments

Comments
 (0)
Please sign in to comment.