Skip to content

Commit 68e79fc

Browse files
authored
Merge 3f5f4cb into a7d5bc7
2 parents a7d5bc7 + 3f5f4cb commit 68e79fc

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

packages/client/lib/client/commands.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ import * as SWAPDB from '../commands/SWAPDB';
118118
import * as TIME from '../commands/TIME';
119119
import * as UNWATCH from '../commands/UNWATCH';
120120
import * as WAIT from '../commands/WAIT';
121-
121+
import * as WAITAOF from '../commands/WAITAOF'
122+
;
122123
export default {
123124
...CLUSTER_COMMANDS,
124125
ACL_CAT,
@@ -358,5 +359,7 @@ export default {
358359
UNWATCH,
359360
unwatch: UNWATCH,
360361
WAIT,
361-
wait: WAIT
362+
wait: WAIT,
363+
WAITAOF,
364+
waitaof: WAITAOF
362365
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { strict as assert } from 'assert';
2+
import testUtils, { GLOBAL } from '../test-utils';
3+
import { transformArguments } from './WAITAOF';
4+
5+
describe('WAITAOF', () => {
6+
testUtils.isVersionGreaterThanHook([7, 2]);
7+
8+
describe('transformArguments', () => {
9+
it('simple', () => {
10+
assert.deepEqual(
11+
transformArguments(1, 0, 0),
12+
['WAITAOF', '1', '0', '0']
13+
);
14+
});
15+
});
16+
17+
testUtils.testWithClient('client.wait', async client => {
18+
assert.equal(
19+
await client.waitaof(1, 0, 0),
20+
[1, 0]
21+
);
22+
}, GLOBAL.SERVERS.OPEN);
23+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { RedisCommandArgument, RedisCommandArguments } from '.';
2+
3+
export function transformArguments(
4+
numlocal: number,
5+
numreplicas: number,
6+
timeout: number
7+
): RedisCommandArguments {
8+
return [
9+
'WAITAOF',
10+
numlocal.toString(),
11+
numreplicas.toString(),
12+
timeout.toString()
13+
];
14+
}
15+
16+
export declare function transformReply(): Array<[number, number]>;

0 commit comments

Comments
 (0)