NodeRedis/node-redis

View on GitHub
packages/bloom/lib/commands/t-digest/CDF.spec.ts

Summary

Maintainability
B
5 hrs
Test Coverage
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../../test-utils';
import { transformArguments } from './CDF';

describe('TDIGEST.CDF', () => {
    it('transformArguments', () => {
        assert.deepEqual(
            transformArguments('key', [1, 2]),
            ['TDIGEST.CDF', 'key', '1', '2']
        );
    });

    testUtils.testWithClient('client.tDigest.cdf', async client => {
        const [ , reply ] = await Promise.all([
            client.tDigest.create('key'),
            client.tDigest.cdf('key', [1])
        ]);

        assert.deepEqual(reply, [NaN]);
    }, GLOBAL.SERVERS.OPEN);
});