You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
@@ -21,6 +21,7 @@ import * as CLIENT_GETNAME from '../commands/CLIENT_GETNAME';
|
||||
import * as CLIENT_GETREDIR from '../commands/CLIENT_GETREDIR';
|
||||
import * as CLIENT_ID from '../commands/CLIENT_ID';
|
||||
import * as CLIENT_KILL from '../commands/CLIENT_KILL';
|
||||
import * as CLIENT_NO_EVICT from '../commands/CLIENT_NO-EVICT';
|
||||
import * as CLIENT_SETNAME from '../commands/CLIENT_SETNAME';
|
||||
import * as CLIENT_INFO from '../commands/CLIENT_INFO';
|
||||
import * as CLUSTER_ADDSLOTS from '../commands/CLUSTER_ADDSLOTS';
|
||||
@@ -158,6 +159,8 @@ export default {
|
||||
clientKill: CLIENT_KILL,
|
||||
CLIENT_SETNAME,
|
||||
clientSetName: CLIENT_SETNAME,
|
||||
'CLIENT_NO-EVICT': CLIENT_NO_EVICT,
|
||||
clientNoEvict: CLIENT_NO_EVICT,
|
||||
CLIENT_INFO,
|
||||
clientInfo: CLIENT_INFO,
|
||||
CLUSTER_ADDSLOTS,
|
||||
|
30
packages/client/lib/commands/CLIENT_NO-EVICT.spec.ts
Normal file
30
packages/client/lib/commands/CLIENT_NO-EVICT.spec.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import testUtils, { GLOBAL } from '../test-utils';
|
||||
import { transformArguments } from './CLIENT_NO-EVICT';
|
||||
|
||||
describe('CLIENT NO-EVICT', () => {
|
||||
testUtils.isVersionGreaterThanHook([7]);
|
||||
|
||||
describe('transformArguments', () => {
|
||||
it('true', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments(true),
|
||||
['CLIENT', 'NO-EVICT', 'ON']
|
||||
);
|
||||
});
|
||||
|
||||
it('false', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments(false),
|
||||
['CLIENT', 'NO-EVICT', 'OFF']
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.clientNoEvict', async client => {
|
||||
assert.equal(
|
||||
await client.clientNoEvict(true),
|
||||
'OK'
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
11
packages/client/lib/commands/CLIENT_NO-EVICT.ts
Normal file
11
packages/client/lib/commands/CLIENT_NO-EVICT.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
|
||||
export function transformArguments(value: boolean): RedisCommandArguments {
|
||||
return [
|
||||
'CLIENT',
|
||||
'NO-EVICT',
|
||||
value ? 'ON' : 'OFF'
|
||||
];
|
||||
}
|
||||
|
||||
export declare function transformReply(): 'OK' | Buffer;
|
Reference in New Issue
Block a user