You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Replace jshint with eslint and add lots of rules
Fix eslint errors accordingly
This commit is contained in:
@ -1,21 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var assert = require("assert");
|
||||
var config = require("../lib/config");
|
||||
var helper = require("../helper");
|
||||
var assert = require('assert');
|
||||
var config = require('../lib/config');
|
||||
var helper = require('../helper');
|
||||
var redis = config.redis;
|
||||
|
||||
describe("The 'client' method", function () {
|
||||
|
||||
helper.allTests(function(parser, ip, args) {
|
||||
helper.allTests(function (parser, ip, args) {
|
||||
var pattern = /addr=/;
|
||||
|
||||
describe("using " + parser + " and " + ip, function () {
|
||||
describe('using ' + parser + ' and ' + ip, function () {
|
||||
var client;
|
||||
|
||||
beforeEach(function (done) {
|
||||
client = redis.createClient.apply(null, args);
|
||||
client.once("ready", function () {
|
||||
client.once('ready', function () {
|
||||
client.flushdb(done);
|
||||
});
|
||||
});
|
||||
@ -26,18 +26,18 @@ describe("The 'client' method", function () {
|
||||
|
||||
describe('list', function () {
|
||||
it('lists connected clients', function (done) {
|
||||
client.client("LIST", helper.match(pattern, done));
|
||||
client.client('LIST', helper.match(pattern, done));
|
||||
});
|
||||
|
||||
it("lists connected clients when invoked with multi's chaining syntax", function (done) {
|
||||
client.multi().client("list").exec(function(err, results) {
|
||||
client.multi().client('list').exec(function (err, results) {
|
||||
assert(pattern.test(results[0]), "expected string '" + results + "' to match " + pattern.toString());
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
it("lists connected clients when invoked with array syntax on client", function (done) {
|
||||
client.multi().client(["list"]).exec(function(err, results) {
|
||||
it('lists connected clients when invoked with array syntax on client', function (done) {
|
||||
client.multi().client(['list']).exec(function (err, results) {
|
||||
assert(pattern.test(results[0]), "expected string '" + results + "' to match " + pattern.toString());
|
||||
return done();
|
||||
});
|
||||
@ -46,7 +46,7 @@ describe("The 'client' method", function () {
|
||||
it("lists connected clients when invoked with multi's array syntax", function (done) {
|
||||
client.multi([
|
||||
['client', 'list']
|
||||
]).exec(function(err, results) {
|
||||
]).exec(function (err, results) {
|
||||
assert(pattern.test(results[0]), "expected string '" + results + "' to match " + pattern.toString());
|
||||
return done();
|
||||
});
|
||||
@ -58,7 +58,7 @@ describe("The 'client' method", function () {
|
||||
|
||||
beforeEach(function (done) {
|
||||
client2 = redis.createClient.apply(redis.createClient, args);
|
||||
client2.once("ready", function () {
|
||||
client2.once('ready', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
@ -72,14 +72,14 @@ describe("The 'client' method", function () {
|
||||
// per chunk. So the execution order is only garanteed on each client
|
||||
var end = helper.callFuncAfter(done, 2);
|
||||
|
||||
client.client("setname", "RUTH", helper.isString('OK'));
|
||||
client2.client("setname", "RENEE", helper.isString('OK'));
|
||||
client2.client("setname", "MARTIN", helper.isString('OK'));
|
||||
client2.client("getname", function(err, res) {
|
||||
client.client('setname', 'RUTH', helper.isString('OK'));
|
||||
client2.client('setname', 'RENEE', helper.isString('OK'));
|
||||
client2.client('setname', 'MARTIN', helper.isString('OK'));
|
||||
client2.client('getname', function (err, res) {
|
||||
assert.equal(res, 'MARTIN');
|
||||
end();
|
||||
});
|
||||
client.client("getname", function(err, res) {
|
||||
client.client('getname', function (err, res) {
|
||||
assert.equal(res, 'RUTH');
|
||||
end();
|
||||
});
|
||||
|
Reference in New Issue
Block a user