1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
This commit is contained in:
Leibale
2023-06-19 18:04:31 -04:00
parent 9c1f2a0f86
commit f150e86f95
47 changed files with 2490 additions and 1798 deletions

View File

@@ -1,41 +1,43 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec';
import { transformArguments } from './FUNCTION_LIST';
import FUNCTION_LIST from './FUNCTION_LIST';
import { MATH_FUNCTION, loadMathFunction } from './FUNCTION_LOAD.spec';
describe('FUNCTION LIST', () => {
testUtils.isVersionGreaterThanHook([7]);
testUtils.isVersionGreaterThanHook([7]);
describe('transformArguments', () => {
it('simple', () => {
assert.deepEqual(
transformArguments(),
['FUNCTION', 'LIST']
);
});
it('with pattern', () => {
assert.deepEqual(
transformArguments('patter*'),
['FUNCTION', 'LIST', 'patter*']
);
});
describe('transformArguments', () => {
it('simple', () => {
assert.deepEqual(
FUNCTION_LIST.transformArguments(),
['FUNCTION', 'LIST']
);
});
testUtils.testWithClient('client.functionList', async client => {
await loadMathFunction(client);
it('with LIBRARYNAME', () => {
assert.deepEqual(
FUNCTION_LIST.transformArguments({
LIBRARYNAME: 'patter*'
}),
['FUNCTION', 'LIST', 'LIBRARYNAME', 'patter*']
);
});
});
assert.deepEqual(
await client.functionList(),
[{
libraryName: MATH_FUNCTION.name,
engine: MATH_FUNCTION.engine,
functions: [{
name: MATH_FUNCTION.library.square.NAME,
description: null,
flags: ['no-writes']
}]
}]
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithClient('client.functionList', async client => {
await loadMathFunction(client);
assert.deepEqual(
await client.functionList(),
[{
library_name: MATH_FUNCTION.name,
engine: MATH_FUNCTION.engine,
functions: [{
name: MATH_FUNCTION.library.square.NAME,
description: null,
flags: ['no-writes']
}]
}]
);
}, GLOBAL.SERVERS.OPEN);
});