|
1 | 1 | import { strict as assert } from 'node:assert';
|
2 | 2 | import testUtils, { GLOBAL } from '../test-utils';
|
3 | 3 | import HSCAN_NOVALUES from './HSCAN_NOVALUES';
|
| 4 | +import { BlobStringReply } from '../RESP/types'; |
4 | 5 |
|
5 | 6 | describe('HSCAN_NOVALUES', () => {
|
6 |
| - testUtils.isVersionGreaterThanHook([7.4]); |
| 7 | + testUtils.isVersionGreaterThanHook([7,4]); |
7 | 8 |
|
8 | 9 | describe('transformArguments', () => {
|
9 | 10 | it('cusror only', () => {
|
@@ -42,6 +43,29 @@ describe('HSCAN_NOVALUES', () => {
|
42 | 43 | });
|
43 | 44 | });
|
44 | 45 |
|
| 46 | + describe('transformReply', () => { |
| 47 | + it('without keys', () => { |
| 48 | + assert.deepEqual( |
| 49 | + HSCAN_NOVALUES.transformReply(['0' as any, []]), |
| 50 | + { |
| 51 | + cursor: '0', |
| 52 | + fields: [] |
| 53 | + } |
| 54 | + ); |
| 55 | + }); |
| 56 | + |
| 57 | + it('with keys', () => { |
| 58 | + assert.deepEqual( |
| 59 | + HSCAN_NOVALUES.transformReply(['0' as any, ['key1', 'key2'] as any]), |
| 60 | + { |
| 61 | + cursor: '0', |
| 62 | + fields: ['key1', 'key2'] |
| 63 | + } |
| 64 | + ); |
| 65 | + }); |
| 66 | + }); |
| 67 | + |
| 68 | + |
45 | 69 | testUtils.testWithClient('client.hScanNoValues', async client => {
|
46 | 70 | const [, reply] = await Promise.all([
|
47 | 71 | client.hSet('key', 'field', 'value'),
|
|
0 commit comments