...
|
...
|
@@ -40,7 +40,6 @@ test('cache get test', (t) => { |
|
|
test('cache get multi test', (t) => {
|
|
|
cache.set(anotherKey, anotherValue);
|
|
|
return cache.getMulti([testKey, anotherKey]).then((values) => {
|
|
|
console.log(values);
|
|
|
t.is(values[testKey], testValue);
|
|
|
t.is(values[anotherKey], JSON.stringify(anotherValue));
|
|
|
});
|
...
|
...
|
@@ -68,3 +67,45 @@ test('cache set to slave', (t) => { |
|
|
cache.del(slaveTestKey);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
test('cache get test, key is not a string', (t) => {
|
|
|
return cache.get(123).then((v) => {
|
|
|
t.notOk(v);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
test('cache get multi test, key is not an array', (t) => {
|
|
|
return cache.getMulti(123).then((v) => {
|
|
|
t.notOk(v);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
test('cache get from slave test, key is not a string', (t) => {
|
|
|
return cache.getFromSlave(123).then((v) => {
|
|
|
t.notOk(v);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
test('cache get multi from slave test, key is not an array', (t) => {
|
|
|
return cache.getMultiFromSlave(123).then((v) => {
|
|
|
t.notOk(v);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
test('cache set test, key is not a string', (t) => {
|
|
|
return cache.set(123).then((v) => {
|
|
|
t.notOk(v);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
test('cache set multi test, key is not an array', (t) => {
|
|
|
return cache.setSlave(123).then((v) => {
|
|
|
t.notOk(v);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
test('cache del test, key is not a string', (t) => {
|
|
|
return cache.del(123).then((v) => {
|
|
|
t.notOk(v);
|
|
|
});
|
|
|
}); |
...
|
...
|
|