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

22 lines
574 B
TypeScript

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