Skip to content

Commit fb3d3df

Browse files
Small changes
1 parent 27a433b commit fb3d3df

12 files changed

+86
-65
lines changed

packages/time-series/lib/commands/DEL.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,10 @@ describe('DEL', () => {
2222
await client.ts.del('key', 1, 100),
2323
2
2424
);
25+
26+
assert.equal(
27+
await client.ts.get('key'),
28+
null
29+
);
2530
}, GLOBAL.SERVERS.OPEN);
2631
});

packages/time-series/lib/commands/INCRBY.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe('INCRBY', () => {
1010
['TS.INCRBY', 'key', '1']
1111
);
1212
});
13+
1314
it('with TIMESTAMP', () => {
1415
assert.deepEqual(
1516
transformArguments('key', 1, {
@@ -18,6 +19,7 @@ describe('INCRBY', () => {
1819
['TS.INCRBY', 'key', '1', 'TIMESTAMP', '*']
1920
);
2021
});
22+
2123
it('with RETENTION', () => {
2224
assert.deepEqual(
2325
transformArguments('key', 1, {
@@ -26,6 +28,7 @@ describe('INCRBY', () => {
2628
['TS.INCRBY', 'key', '1', 'RETENTION', '100']
2729
);
2830
});
31+
2932
it('with UNCOMPRESSED', () => {
3033
assert.deepEqual(
3134
transformArguments('key', 1, {
@@ -34,6 +37,7 @@ describe('INCRBY', () => {
3437
['TS.INCRBY', 'key', '1', 'UNCOMPRESSED']
3538
);
3639
});
40+
3741
it('without UNCOMPRESSED', () => {
3842
assert.deepEqual(
3943
transformArguments('key', 1, {
@@ -42,6 +46,7 @@ describe('INCRBY', () => {
4246
['TS.INCRBY', 'key', '1']
4347
);
4448
});
49+
4550
it('with CHUNK_SIZE', () => {
4651
assert.deepEqual(
4752
transformArguments('key', 1, {
@@ -50,6 +55,7 @@ describe('INCRBY', () => {
5055
['TS.INCRBY', 'key', '1', 'CHUNK_SIZE', '100']
5156
);
5257
});
58+
5359
it('with LABELS', () => {
5460
assert.deepEqual(
5561
transformArguments('key', 1, {
@@ -58,6 +64,7 @@ describe('INCRBY', () => {
5864
['TS.INCRBY', 'key', '1', 'LABELS', 'label', 'value']
5965
);
6066
});
67+
6168
it('with TIMESTAMP, RETENTION, UNCOMPRESSED, CHUNK_SIZE and LABELS', () => {
6269
assert.deepEqual(
6370
transformArguments('key', 1, {
@@ -73,7 +80,7 @@ describe('INCRBY', () => {
7380
});
7481
});
7582

76-
testUtils.testWithClient('client.ts.decrBy', async client => {
83+
testUtils.testWithClient('client.ts.incrBy', async client => {
7784
await Promise.all([
7885
client.ts.create('key'),
7986
]);

packages/time-series/lib/commands/MADD.spec.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,24 @@ describe('MADD', () => {
2222

2323
// Should we check empty array?
2424

25-
// testUtils.testWithClient('client.ts.madd', async client => {
26-
// // await Promise.all([
27-
// // client.ts.create('key', {
28-
// // la
29-
// // }),
30-
// // ]);
25+
testUtils.testWithClient('client.ts.madd', async client => {
26+
await Promise.all([
27+
client.ts.create('key')
28+
]);
3129

32-
// assert.deepEqual(
33-
// await client.ts.mAdd([
34-
// {
35-
// key: 'key',
36-
// timestamp: 1,
37-
// value: 0
38-
// }]),
39-
// [1]
40-
// );
41-
// }, GLOBAL.SERVERS.OPEN);
30+
assert.deepEqual(
31+
await client.ts.mAdd([
32+
{
33+
key: 'key',
34+
timestamp: 1,
35+
value: 0
36+
},
37+
{
38+
key: 'key',
39+
timestamp: 2,
40+
value: 10
41+
}]),
42+
[1, 2]
43+
);
44+
}, GLOBAL.SERVERS.OPEN);
4245
});

packages/time-series/lib/commands/MGET.spec.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@ import testUtils, { GLOBAL } from '../test-utils';
33
import { transformArguments } from './MGET';
44

55
describe('MGET', () => {
6-
describe('transformArguments', () => {
7-
it('onlyFilters', () => {
8-
assert.deepEqual(
9-
transformArguments(['name=value', 'age!=']),
10-
['TS.MGET', 'FILTER', 'name=value', 'age!=']
11-
);
12-
});
6+
it('transformArguments', () => {
7+
assert.deepEqual(
8+
transformArguments(['name=value', 'age!=']),
9+
['TS.MGET', 'FILTER', 'name=value', 'age!=']
10+
);
1311
});
1412

1513

16-
testUtils.testWithClient('client.ts.get', async client => {
14+
testUtils.testWithClient('client.ts.mget', async client => {
1715
await Promise.all([
1816
client.ts.create('key', {
1917
LABELS: {Test: 'This'}

packages/time-series/lib/commands/MGETWITHLABELS.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ describe('MGETWITHLABELS', () => {
66
describe('transformArguments', () => {
77
it('without options', () => {
88
assert.deepEqual(
9-
transformArguments(['name=value', 'age!=']),
10-
['TS.MGET', 'WITHLABELS', 'FILTER', 'name=value', 'age!=']
9+
transformArguments(['name=value']),
10+
['TS.MGET', 'WITHLABELS', 'FILTER', 'name=value']
1111
);
1212
});
1313

@@ -20,7 +20,7 @@ describe('MGETWITHLABELS', () => {
2020
});
2121

2222

23-
testUtils.testWithClient('client.ts.get', async client => {
23+
testUtils.testWithClient('client.ts.mgetwithlabels', async client => {
2424
await Promise.all([
2525
client.ts.create('key', {LABELS: {Test: 'This'}}),
2626
client.ts.add('key', 10, 15),

packages/time-series/lib/commands/MGETWITHLABELS.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { pushVerdictArguments } from '@node-redis/client/lib/commands/generic-transformers';
21
import { Labels, MGetRawReply, pushWithLabelsArgument, SelectedLabels, transformLablesReply, transformSampleReply } from '.';
32
import { MGetReply } from './MGET';
43

54
export const IS_READ_ONLY = true;
65

76
export interface MGetWithLabelsReply extends MGetReply{
8-
labels: Labels,
7+
labels: Labels
98
}
109

1110
export function transformArguments(filters: Array<string>, options?: SelectedLabels): Array<string> {

packages/time-series/lib/commands/MRANGE.spec.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,21 @@ describe('MRANGE', () => {
111111
[
112112
{
113113
key: 'key1',
114-
samples: [{
115-
timestamp: 1,
116-
value: 2
117-
}]
114+
samples: [
115+
{
116+
timestamp: 1,
117+
value: 2
118+
}
119+
]
118120
},
119121
{
120122
key: 'key2',
121-
samples: [{
122-
timestamp: 0,
123-
value: 2
124-
}]
123+
samples: [
124+
{
125+
timestamp: 0,
126+
value: 2
127+
}
128+
]
125129
}
126130
]
127131
);

packages/time-series/lib/commands/MRANGEWITHLABELS.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ describe('MRANGEWITHLABELS', () => {
120120
{
121121
key: 'key1',
122122
labels: { MRANGEkey: 'MRANGEvalue' },
123-
samples: [{
124-
timestamp: 1,
125-
value: 2
126-
}]
123+
samples: [
124+
{
125+
timestamp: 1,
126+
value: 2
127+
}
128+
]
127129
}
128130
]
129131
);

packages/time-series/lib/commands/MREVRANGE.spec.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,21 @@ describe('MREVRANGE', () => {
111111
[
112112
{
113113
key: 'key2',
114-
samples: [{
115-
timestamp: 0,
116-
value: 2
117-
}]
114+
samples: [
115+
{
116+
timestamp: 0,
117+
value: 2
118+
}
119+
]
118120
},
119121
{
120122
key: 'key1',
121-
samples: [{
122-
timestamp: 1,
123-
value: 2
124-
}]
123+
samples: [
124+
{
125+
timestamp: 1,
126+
value: 2
127+
}
128+
]
125129
}
126130
]
127131
);

packages/time-series/lib/commands/MREVRANGEWITHLABELS.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ describe('MREVRANGEWITHLABELS', () => {
6363
{
6464
key: 'key1',
6565
labels: { MREVRANGEkey: 'MREVRANGEvalue' },
66-
samples: [{
67-
timestamp: 1,
68-
value: 2
69-
}]
66+
samples: [
67+
{
68+
timestamp: 1,
69+
value: 2
70+
}
71+
]
7072
}
7173
]
7274
);

0 commit comments

Comments
 (0)