-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
CLIENT NO-TOUCH
(#2497)
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { strict as assert } from 'assert'; | ||
import testUtils, { GLOBAL } from '../test-utils'; | ||
import { transformArguments } from './CLIENT_NO-TOUCH'; | ||
|
||
describe('CLIENT NO-TOUCH', () => { | ||
testUtils.isVersionGreaterThanHook([7, 2]); | ||
|
||
describe('transformArguments', () => { | ||
it('true', () => { | ||
assert.deepEqual( | ||
transformArguments(true), | ||
['CLIENT', 'NO-TOUCH', 'ON'] | ||
); | ||
}); | ||
|
||
it('false', () => { | ||
assert.deepEqual( | ||
transformArguments(false), | ||
['CLIENT', 'NO-TOUCH', 'OFF'] | ||
); | ||
}); | ||
}); | ||
|
||
testUtils.testWithClient('client.clientNoTouch', async client => { | ||
assert.equal( | ||
await client.clientNoTouch(true), | ||
'OK' | ||
); | ||
}, GLOBAL.SERVERS.OPEN); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { RedisCommandArguments } from '.'; | ||
|
||
export function transformArguments(value: boolean): RedisCommandArguments { | ||
return [ | ||
'CLIENT', | ||
'NO-TOUCH', | ||
value ? 'ON' : 'OFF' | ||
]; | ||
} | ||
|
||
export declare function transformReply(): 'OK' | Buffer; |