1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/packages/json/lib/commands/TOGGLE.spec.ts
2023-07-10 17:41:02 -04:00

31 lines
729 B
TypeScript

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import TOGGLE from './TOGGLE';
describe('JSON.TOGGLE', () => {
describe('transformArguments', () => {
it('without path', () => {
assert.deepEqual(
TOGGLE.transformArguments('key'),
['JSON.TOGGLE', 'key']
);
});
it('with path', () => {
assert.deepEqual(
TOGGLE.transformArguments('key', '$'),
['JSON.TOGGLE', 'key', '$']
);
});
});
testUtils.testWithClient('client.json.toggle', async client => {
await client.json.set('key', '$', '');
assert.deepEqual(
await client.json.toggle('key', '$'),
[0]
);
}, GLOBAL.SERVERS.OPEN);
});