1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
node-redis/packages/client/lib/commands/FCALL.spec.ts
Leibale f150e86f95 wip
2023-06-19 18:04:31 -04:00

30 lines
758 B
TypeScript

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { MATH_FUNCTION, loadMathFunction } from './FUNCTION_LOAD.spec';
import FCALL from './FCALL';
describe('FCALL', () => {
testUtils.isVersionGreaterThanHook([7]);
it('transformArguments', () => {
assert.deepEqual(
FCALL.transformArguments('function', {
keys: ['key'],
arguments: ['argument']
}),
['FCALL', 'function', '1', 'key', 'argument']
);
});
testUtils.testWithClient('client.fCall', async client => {
await loadMathFunction(client);
assert.equal(
await client.fCall(MATH_FUNCTION.library.square.NAME, {
arguments: ['2']
}),
4
);
}, GLOBAL.SERVERS.OPEN);
});