You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
init time series
This commit is contained in:
25
packages/time-series/lib/commands/CREATERULE.spec.ts
Normal file
25
packages/time-series/lib/commands/CREATERULE.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import { TimeSeriesAggregationType } from '.';
|
||||
import testUtils, { GLOBAL } from '../test-utils';
|
||||
import { transformArguments } from './CREATERULE';
|
||||
|
||||
describe('CREATERULE', () => {
|
||||
it('transformArguments', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('source', 'destination', TimeSeriesAggregationType.AVARAGE, 1),
|
||||
['TS.CREATERULE', 'source', 'destination', 'avg', 1]
|
||||
);
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.ts.createRule', async client => {
|
||||
await Promise.all([
|
||||
client.ts.create('source'),
|
||||
client.ts.create('destination')
|
||||
]);
|
||||
|
||||
assert.equal(
|
||||
await client.ts.createRule('source', 'destination', TimeSeriesAggregationType.AVARAGE, 1),
|
||||
'OK'
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
Reference in New Issue
Block a user