Skip to content

Commit

Permalink
fix code for eslint rules [indent, eqeqeq]
Browse files Browse the repository at this point in the history
  • Loading branch information
TK-one committed Aug 6, 2018
1 parent 0e7769e commit a54eb99
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 71 deletions.
68 changes: 34 additions & 34 deletions test/batch.spec.js
Expand Up @@ -187,12 +187,12 @@ describe("The 'batch' method", function () {
['del', 'some set'],
['smembers', 'some set', undefined] // The explicit undefined is handled as a callback that is undefined
])
.scard('some set')
.exec(function (err, replies) {
assert.strictEqual(4, replies[0].length);
assert.strictEqual(0, replies[2].length);
return done();
});
.scard('some set')
.exec(function (err, replies) {
assert.strictEqual(4, replies[0].length);
assert.strictEqual(0, replies[2].length);
return done();
});
});

it('allows multiple operations to be performed using constructor with all kinds of syntax', function (done) {
Expand All @@ -213,29 +213,29 @@ describe("The 'batch' method", function () {
['HMSET', 'batchhmset', ['batchbar', 'batchbaz']],
['hmset', 'batchhmset', ['batchbar', 'batchbaz'], helper.isString('OK')],
])
.hmget(now, 123456789, 'otherTypes')
.hmget('key2', arr2, function noop () {})
.hmget(['batchhmset2', 'some manner of key', 'batchbar3'])
.mget('batchfoo2', ['batchfoo3', 'batchfoo'], function (err, res) {
assert.strictEqual(res[0], 'batchbar2');
assert.strictEqual(res[1], 'batchbar3');
assert.strictEqual(res[2], null);
})
.exec(function (err, replies) {
assert.equal(arr.length, 3);
assert.equal(arr2.length, 2);
assert.equal(arr3.length, 3);
assert.equal(arr4.length, 3);
assert.strictEqual(null, err);
assert.equal(replies[10][1], '555');
assert.equal(replies[11][0], 'a type of value');
assert.strictEqual(replies[12][0], null);
assert.equal(replies[12][1], 'test');
assert.equal(replies[13][0], 'batchbar2');
assert.equal(replies[13].length, 3);
assert.equal(replies.length, 14);
return done();
});
.hmget(now, 123456789, 'otherTypes')
.hmget('key2', arr2, function noop () {})
.hmget(['batchhmset2', 'some manner of key', 'batchbar3'])
.mget('batchfoo2', ['batchfoo3', 'batchfoo'], function (err, res) {
assert.strictEqual(res[0], 'batchbar2');
assert.strictEqual(res[1], 'batchbar3');
assert.strictEqual(res[2], null);
})
.exec(function (err, replies) {
assert.equal(arr.length, 3);
assert.equal(arr2.length, 2);
assert.equal(arr3.length, 3);
assert.equal(arr4.length, 3);
assert.strictEqual(null, err);
assert.equal(replies[10][1], '555');
assert.equal(replies[11][0], 'a type of value');
assert.strictEqual(replies[12][0], null);
assert.equal(replies[12][1], 'test');
assert.equal(replies[13][0], 'batchbar2');
assert.equal(replies[13].length, 3);
assert.equal(replies.length, 14);
return done();
});
});

it('converts a non string key to a string', function (done) {
Expand Down Expand Up @@ -316,11 +316,11 @@ describe("The 'batch' method", function () {
['mget', ['batchfoo', 'some', 'random value', 'keys']],
['incr', 'batchfoo']
])
.exec(function (err, replies) {
assert.strictEqual(replies.length, 2);
assert.strictEqual(replies[0].length, 4);
return done();
});
.exec(function (err, replies) {
assert.strictEqual(replies.length, 2);
assert.strictEqual(replies[0].length, 4);
return done();
});
});

it('allows multiple operations to be performed on a hash', function (done) {
Expand Down
4 changes: 2 additions & 2 deletions test/commands/select.spec.js
Expand Up @@ -72,7 +72,7 @@ describe("The 'select' method", function () {
assert.strictEqual(client.selected_db, undefined, 'default db should be undefined');
client.select(9999, function (err) {
assert.equal(err.code, 'ERR');
assert((err.message == 'ERR DB index is out of range' || err.message == 'ERR invalid DB index'));
assert((err.message === 'ERR DB index is out of range' || err.message === 'ERR invalid DB index'));
done();
});
});
Expand All @@ -97,7 +97,7 @@ describe("The 'select' method", function () {

client.on('error', function (err) {
assert.strictEqual(err.command, 'SELECT');
assert((err.message == 'ERR DB index is out of range' || err.message == 'ERR invalid DB index'));
assert((err.message === 'ERR DB index is out of range' || err.message === 'ERR invalid DB index'));
done();
});

Expand Down
70 changes: 35 additions & 35 deletions test/multi.spec.js
Expand Up @@ -379,12 +379,12 @@ describe("The 'multi' method", function () {
['del', 'some set'],
['smembers', 'some set']
])
.scard('some set')
.exec(function (err, replies) {
assert.strictEqual(4, replies[0].length);
assert.strictEqual(0, replies[2].length);
return done();
});
.scard('some set')
.exec(function (err, replies) {
assert.strictEqual(4, replies[0].length);
assert.strictEqual(0, replies[2].length);
return done();
});
});

it('allows multiple operations to be performed using constructor with all kinds of syntax', function (done) {
Expand All @@ -406,30 +406,30 @@ describe("The 'multi' method", function () {
['HMSET', 'multihmset', ['multibar', 'multibaz'], undefined], // undefined is used as a explicit not set callback variable
['hmset', 'multihmset', ['multibar', 'multibaz'], helper.isString('OK')],
])
.hmget(now, 123456789, 'otherTypes')
.hmget('key2', arr2, function noop () {})
.hmget(['multihmset2', 'some manner of key', 'multibar3'])
.mget('multifoo2', ['multifoo3', 'multifoo'], function (err, res) {
assert(res[0], 'multifoo3');
assert(res[1], 'multifoo');
called = true;
})
.exec(function (err, replies) {
assert(called);
assert.equal(arr.length, 3);
assert.equal(arr2.length, 2);
assert.equal(arr3.length, 3);
assert.equal(arr4.length, 3);
assert.strictEqual(null, err);
assert.equal(replies[10][1], '555');
assert.equal(replies[11][0], 'a type of value');
assert.strictEqual(replies[12][0], null);
assert.equal(replies[12][1], 'test');
assert.equal(replies[13][0], 'multibar2');
assert.equal(replies[13].length, 3);
assert.equal(replies.length, 14);
return done();
});
.hmget(now, 123456789, 'otherTypes')
.hmget('key2', arr2, function noop () {})
.hmget(['multihmset2', 'some manner of key', 'multibar3'])
.mget('multifoo2', ['multifoo3', 'multifoo'], function (err, res) {
assert(res[0], 'multifoo3');
assert(res[1], 'multifoo');
called = true;
})
.exec(function (err, replies) {
assert(called);
assert.equal(arr.length, 3);
assert.equal(arr2.length, 2);
assert.equal(arr3.length, 3);
assert.equal(arr4.length, 3);
assert.strictEqual(null, err);
assert.equal(replies[10][1], '555');
assert.equal(replies[11][0], 'a type of value');
assert.strictEqual(replies[12][0], null);
assert.equal(replies[12][1], 'test');
assert.equal(replies[13][0], 'multibar2');
assert.equal(replies[13].length, 3);
assert.equal(replies.length, 14);
return done();
});
});

it('converts a non string key to a string', function (done) {
Expand Down Expand Up @@ -505,11 +505,11 @@ describe("The 'multi' method", function () {
['mget', ['multifoo', 'some', 'random value', 'keys']],
['incr', 'multifoo']
])
.exec(function (err, replies) {
assert.strictEqual(replies.length, 2);
assert.strictEqual(replies[0].length, 4);
return done();
});
.exec(function (err, replies) {
assert.strictEqual(replies.length, 2);
assert.strictEqual(replies[0].length, 4);
return done();
});
});

it('allows multiple operations to be performed on a hash', function (done) {
Expand Down

0 comments on commit a54eb99

Please sign in to comment.