1
0
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:
Ruben Bridgewater
2016-03-26 04:05:43 +01:00
parent 12579e5e8e
commit 94e9f1fcfc
98 changed files with 1621 additions and 1551 deletions

View File

@ -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();
});