Skip to content

Commit 7de6dc0

Browse files
author
arthosofteq
authored
add 'await' for sleep ;) (#782)
1 parent b501a0f commit 7de6dc0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

redisinsight/api/test/api/ws/pub-sub/pub-sub.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,20 @@ describe('pub-sub', function () {
130130
client.on('p:*', (data) => messages['*'].push(...data.messages));
131131

132132
await new Promise((resolve) => {
133-
client.emit('subscribe', { subscriptions: [subscription, subscriptionB, pSubscription] }, async (ack) => {
133+
client.emit('subscribe', { subscriptions: [subscription, subscriptionB, pSubscription] }, (ack) => {
134134
expect(ack).to.eql({ status: 'ok' });
135135

136136
client.on('s:channel-b', resolve);
137137

138-
await rte.data.sendCommand('publish', ['channel-a', 'message-a']);
139-
await rte.data.sendCommand('publish', ['channel-a', 'message-a']);
140-
await rte.data.sendCommand('publish', ['channel-a', 'message-a']);
141-
await rte.data.sendCommand('publish', ['channel-a', 'message-a']);
142-
await rte.data.sendCommand('publish', ['channel-b', 'message-b']);
138+
rte.data.sendCommand('publish', ['channel-a', 'message-a']);
139+
rte.data.sendCommand('publish', ['channel-a', 'message-a']);
140+
rte.data.sendCommand('publish', ['channel-a', 'message-a']);
141+
rte.data.sendCommand('publish', ['channel-a', 'message-a']);
142+
rte.data.sendCommand('publish', ['channel-b', 'message-b']);
143143
})
144144
});
145145

146-
sleep(3000);
146+
await sleep(3000);
147147

148148
expect(messages['channel-a'].length).to.eql(4);
149149
messages['channel-a'].forEach(message => {

0 commit comments

Comments
 (0)