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,16 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var assert = require('assert');
|
||||
var config = require("../lib/config");
|
||||
var config = require('../lib/config');
|
||||
var helper = require('../helper');
|
||||
var redis = config.redis;
|
||||
var uuid = require('uuid');
|
||||
|
||||
describe("The 'mset' method", function () {
|
||||
|
||||
helper.allTests(function(parser, ip, args) {
|
||||
helper.allTests(function (parser, ip, args) {
|
||||
|
||||
describe("using " + parser + " and " + ip, function () {
|
||||
describe('using ' + parser + ' and ' + ip, function () {
|
||||
var key, value, key2, value2;
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -20,18 +20,18 @@ describe("The 'mset' method", function () {
|
||||
value2 = uuid.v4();
|
||||
});
|
||||
|
||||
describe("when not connected", function () {
|
||||
describe('when not connected', function () {
|
||||
var client;
|
||||
|
||||
beforeEach(function (done) {
|
||||
client = redis.createClient.apply(null, args);
|
||||
client.once("ready", function () {
|
||||
client.once('ready', function () {
|
||||
client.quit();
|
||||
});
|
||||
client.on('end', done);
|
||||
});
|
||||
|
||||
it("reports an error", function (done) {
|
||||
it('reports an error', function (done) {
|
||||
client.mset(key, value, key2, value2, function (err, res) {
|
||||
assert(err.message.match(/The connection has already been closed/));
|
||||
done();
|
||||
@@ -39,12 +39,12 @@ describe("The 'mset' method", function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe("when connected", function () {
|
||||
describe('when connected', function () {
|
||||
var client;
|
||||
|
||||
beforeEach(function (done) {
|
||||
client = redis.createClient.apply(null, args);
|
||||
client.once("ready", function () {
|
||||
client.once('ready', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -53,10 +53,10 @@ describe("The 'mset' method", function () {
|
||||
client.end(true);
|
||||
});
|
||||
|
||||
describe("and a callback is specified", function () {
|
||||
describe("with valid parameters", function () {
|
||||
it("sets the value correctly", function (done) {
|
||||
client.mset(key, value, key2, value2, function(err) {
|
||||
describe('and a callback is specified', function () {
|
||||
describe('with valid parameters', function () {
|
||||
it('sets the value correctly', function (done) {
|
||||
client.mset(key, value, key2, value2, function (err) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ describe("The 'mset' method", function () {
|
||||
});
|
||||
|
||||
describe("with undefined 'key' parameter and missing 'value' parameter", function () {
|
||||
it("reports an error", function (done) {
|
||||
it('reports an error', function (done) {
|
||||
client.mset(undefined, function (err, res) {
|
||||
helper.isError()(err, null);
|
||||
done();
|
||||
@@ -77,15 +77,15 @@ describe("The 'mset' method", function () {
|
||||
|
||||
});
|
||||
|
||||
describe("and no callback is specified", function () {
|
||||
describe("with valid parameters", function () {
|
||||
it("sets the value correctly", function (done) {
|
||||
describe('and no callback is specified', function () {
|
||||
describe('with valid parameters', function () {
|
||||
it('sets the value correctly', function (done) {
|
||||
client.mset(key, value2, key2, value);
|
||||
client.get(key, helper.isString(value2));
|
||||
client.get(key2, helper.isString(value, done));
|
||||
});
|
||||
|
||||
it("sets the value correctly with array syntax", function (done) {
|
||||
it('sets the value correctly with array syntax', function (done) {
|
||||
client.mset([key, value2, key2, value]);
|
||||
client.get(key, helper.isString(value2));
|
||||
client.get(key2, helper.isString(value, done));
|
||||
@@ -94,7 +94,7 @@ describe("The 'mset' method", function () {
|
||||
|
||||
describe("with undefined 'key' and missing 'value' parameter", function () {
|
||||
// this behavior is different from the 'set' behavior.
|
||||
it("emits an error", function (done) {
|
||||
it('emits an error', function (done) {
|
||||
client.on('error', function (err) {
|
||||
assert.equal(err.message, "ERR wrong number of arguments for 'mset' command");
|
||||
done();
|
||||
|
Reference in New Issue
Block a user