You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* churn(test): use redislabs/client-libs-test for testing This switches our testing infrastructure from redis/redis-stack to redislabs/client-libs-test Docker image across all packages. This change also updates the default Docker version from 7.4.0-v1 to 8.0-M04-pre. * churn(test): verify CONFIG SET / GET compatibility with Redis 8 - Add tests for Redis 8 search configuration settings - Deprecate Redis Search CONFIG commands in favor of standard CONFIG - Test read-only config restrictions for Redis 8 * churn(test): handle Redis 8 coordinate precision in GEOPOS - Update GEOPOS tests to handle increased precision in Redis 8 (17 decimal places vs 14) - Add precision-aware coordinate comparison helper - Add comprehensive test suite for coordinate comparison function * test(search): adapt SUGGET tests for Redis 8 empty results - Update tests to expect empty array ([]) instead of null for SUGGET variants - Affects sugGet, sugGetWithPayloads, sugGetWithScores, and sugGetWithScoresWithPayloads * test(search): support Redis 8 INFO indexes_all field - Add indexes_all field introduced in Redis 8 to index definition test * refactor!(search): simplify PROFILE commands to return raw response - BREAKING CHANGE: FT.PROFILE now returns raw response, letting users implement their own parsing * test: improve version-specific test coverage - Add `testWithClientIfVersionWithinRange` method to run tests for specific Redis versions - Refactor TestUtils to handle version comparisons more accurately - Update test utilities across Redis modules to run tests against multiple versions, and not against latest only
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
import { strict as assert } from 'node:assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import CONFIG_GET from './CONFIG_GET';
|
|
import { parseArgs } from './generic-transformers';
|
|
|
|
describe('CONFIG GET', () => {
|
|
describe('transformArguments', () => {
|
|
it('string', () => {
|
|
assert.deepEqual(
|
|
parseArgs(CONFIG_GET, '*'),
|
|
['CONFIG', 'GET', '*']
|
|
);
|
|
});
|
|
|
|
it('Array', () => {
|
|
assert.deepEqual(
|
|
parseArgs(CONFIG_GET, ['1', '2']),
|
|
['CONFIG', 'GET', '1', '2']
|
|
);
|
|
});
|
|
});
|
|
|
|
testUtils.testWithClient('client.configGet', async client => {
|
|
const config = await client.configGet('*');
|
|
assert.equal(typeof config, 'object');
|
|
for (const [key, value] of Object.entries(config)) {
|
|
assert.equal(typeof key, 'string');
|
|
assert.equal(typeof value, 'string');
|
|
}
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
|
|
testUtils.testWithClient('client.configSet.getSearchConfigSettingTest | Redis >= 8', async client => {
|
|
assert.ok(
|
|
await client.configGet('search-timeout'),
|
|
'OK'
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
|
|
testUtils.testWithClient('client.configSet.getTSConfigSettingTest | Redis >= 8', async client => {
|
|
assert.ok(
|
|
await client.configGet('ts-retention-policy'),
|
|
'OK'
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
|
|
testUtils.testWithClient('client.configSet.getBFConfigSettingTest | Redis >= 8', async client => {
|
|
assert.ok(
|
|
await client.configGet('bf-error-rate'),
|
|
'OK'
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
|
|
testUtils.testWithClient('client.configSet.getCFConfigSettingTest | Redis >= 8', async client => {
|
|
assert.ok(
|
|
await client.configGet('cf-initial-size'),
|
|
'OK'
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
|
|
});
|