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 'dbsize' 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;
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -18,18 +18,18 @@ describe("The 'dbsize' method", function () {
|
||||
value = 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.dbsize([], function (err, res) {
|
||||
assert(err.message.match(/The connection has already been closed/));
|
||||
done();
|
||||
@@ -37,14 +37,14 @@ describe("The 'dbsize' 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 () {
|
||||
client.flushdb(function (err, res) {
|
||||
helper.isString("OK")(err, res);
|
||||
helper.isString('OK')(err, res);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -54,22 +54,22 @@ describe("The 'dbsize' method", function () {
|
||||
client.end(true);
|
||||
});
|
||||
|
||||
it("returns a zero db size", function (done) {
|
||||
it('returns a zero db size', function (done) {
|
||||
client.DBSIZE([], function (err, res) {
|
||||
helper.isNotError()(err, res);
|
||||
helper.isType.number()(err, res);
|
||||
assert.strictEqual(res, 0, "Initial db size should be 0");
|
||||
assert.strictEqual(res, 0, 'Initial db size should be 0');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when more data is added to Redis", function () {
|
||||
describe('when more data is added to Redis', function () {
|
||||
var oldSize;
|
||||
|
||||
beforeEach(function (done) {
|
||||
client.dbsize(function (err, res) {
|
||||
helper.isType.number()(err, res);
|
||||
assert.strictEqual(res, 0, "Initial db size should be 0");
|
||||
assert.strictEqual(res, 0, 'Initial db size should be 0');
|
||||
|
||||
oldSize = res;
|
||||
|
||||
@@ -80,11 +80,11 @@ describe("The 'dbsize' method", function () {
|
||||
});
|
||||
});
|
||||
|
||||
it("returns a larger db size", function (done) {
|
||||
it('returns a larger db size', function (done) {
|
||||
client.dbsize([], function (err, res) {
|
||||
helper.isNotError()(err, res);
|
||||
helper.isType.positiveNumber()(err, res);
|
||||
assert.strictEqual(true, (oldSize < res), "Adding data should increase db size.");
|
||||
assert.strictEqual(true, (oldSize < res), 'Adding data should increase db size.');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user