1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-11 22:42:42 +03:00
Files
node-redis/lib/commands/HGETALL.spec.ts
2021-06-11 16:37:04 -04:00

42 lines
1.2 KiB
TypeScript

import { strict as assert } from 'assert';
import { TestRedisServers, itWithClient } from '../test-utils';
import { transformReply } from './HGETALL';
describe('HGETALL', () => {
describe('transformReply', () => {
it('empty', () => {
assert.deepEqual(
transformReply([]),
Object.create(null)
);
});
it('with values', () => {
assert.deepEqual(
transformReply(['key1', 'value1', 'key2', 'value2']),
Object.create(null, {
key1: {
value: 'value1',
configurable: true,
enumerable: true,
writable: true
},
key2: {
value: 'value2',
configurable: true,
enumerable: true,
writable: true
}
})
);
});
});
itWithClient(TestRedisServers.OPEN, 'client.hGetAll', async client => {
assert.deepEqual(
await client.hGetAll('key'),
Object.create(null)
);
});
});