Skip to content

Commit

Permalink
add zincrby test
Browse files Browse the repository at this point in the history
  • Loading branch information
ademilter committed Oct 24, 2021
1 parent 0b54ac6 commit 5d7d245
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upstash/redis",
"version": "0.1.0",
"version": "0.1.1",
"description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
"author": "Adem ilter <[email protected]>",
"license": "MIT",
Expand Down
17 changes: 17 additions & 0 deletions test/zincrby.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { zadd, zrange, zincrby } from '../src';
import { nanoid } from 'nanoid';

describe('zincrby command', () => {
it('basic', async () => {
const key = nanoid();

const { data: addData } = await zadd(key, [0, 'a', 4, 'b']);
expect(addData).toBe(2);

const { data: incrData } = await zincrby(key, 10, 'a');
expect(incrData).toBe('10');

const { data: rangeData } = await zrange(key, 0, -1, { withScores: true });
expect(rangeData).toMatchObject(['b', '4', 'a', '10']);
});
});

0 comments on commit 5d7d245

Please sign in to comment.