Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Chloe Yip <[email protected]>
  • Loading branch information
cyip10 committed Aug 15, 2024
1 parent 48674ee commit d3aab02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3789,7 +3789,7 @@ export function runBaseTests<Context>(config: {
expect(await client.zadd(key2, membersScores2)).toEqual(3);

// Union results are aggregated by the MAX score of elements
expect(await client.zunionStore(key3, [key1, key2], "MAX")).toEqual(3);
expect(await client.zunionstore(key3, [key1, key2], "MAX")).toEqual(3);
const zunionstoreMapMax = await client.zrangeWithScores(key3, range);
const expectedMapMax = {
one: 1.5,
Expand All @@ -3815,7 +3815,7 @@ export function runBaseTests<Context>(config: {
expect(await client.zadd(key2, membersScores2)).toEqual(3);

// Union results are aggregated by the MIN score of elements
expect(await client.zunionStore(key3, [key1, key2], "MIN")).toEqual(3);
expect(await client.zunionstore(key3, [key1, key2], "MIN")).toEqual(3);
const zunionstoreMapMin = await client.zrangeWithScores(key3, range);
const expectedMapMin = {
one: 1.0,
Expand All @@ -3841,7 +3841,7 @@ export function runBaseTests<Context>(config: {
expect(await client.zadd(key2, membersScores2)).toEqual(3);

// Union results are aggregated by the SUM score of elements
expect(await client.zunionStore(key3, [key1, key2], "SUM")).toEqual(3);
expect(await client.zunionstore(key3, [key1, key2], "SUM")).toEqual(3);
const zunionstoreMapSum = await client.zrangeWithScores(key3, range);
const expectedMapSum = {
one: 2.5,
Expand All @@ -3866,7 +3866,7 @@ export function runBaseTests<Context>(config: {
expect(await client.zadd(key1, membersScores1)).toEqual(2);
expect(await client.zadd(key2, membersScores2)).toEqual(3);

expect(await client.zunionStore(key3, [key1, key2])).toEqual(3);
expect(await client.zunionstore(key3, [key1, key2])).toEqual(3);
const zunionstoreMap = await client.zrangeWithScores(key3, range);
const expectedMap = {
one: 3.0,
Expand All @@ -3892,7 +3892,7 @@ export function runBaseTests<Context>(config: {

// Scores are multiplied by 2.0 for key1 and key2 during aggregation.
expect(
await client.zunionStore(
await client.zunionstore(
key3,
[
[key1, 2.0],
Expand Down Expand Up @@ -3926,7 +3926,7 @@ export function runBaseTests<Context>(config: {

// Non existing key
expect(
await client.zunionStore(key2, [
await client.zunionstore(key2, [
key1,
"{testKey}-non_existing_key",
]),
Expand All @@ -3944,7 +3944,7 @@ export function runBaseTests<Context>(config: {
expect(zunionstore_map_nonexistingkey).toEqual(expectedMapMultiplied);

// Empty list check
await expect(client.zunionStore("{xyz}", [])).rejects.toThrow();
await expect(client.zunionstore("{xyz}", [])).rejects.toThrow();
}

it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])(
Expand Down
2 changes: 2 additions & 0 deletions node/tests/TestUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,8 @@ export async function transactionTest(
responseData.push(["zdiffWithScores([key13, key12])", { three: 3.5 }]);
baseTransaction.zdiffstore(key13, [key13, key13]);
responseData.push(["zdiffstore(key13, [key13, key13])", 0]);
baseTransaction.zunionstore(key5, [key12, key13]);
responseData.push(["zunionstore(key5, [key12, key13])", 2]);
baseTransaction.zmscore(key12, ["two", "one"]);
responseData.push(['zmscore(key12, ["two", "one"]', [2.0, 1.0]]);
baseTransaction.zinterstore(key12, [key12, key13]);
Expand Down

0 comments on commit d3aab02

Please sign in to comment.