Skip to content

Commit 7e22f0b

Browse files
ObjectType added in scan test
Signed-off-by: Prateek Kumar <[email protected]>
1 parent 7c317fe commit 7e22f0b

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

node/tests/ScanTest.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
GlideClient,
1010
GlideClusterClient,
1111
GlideString,
12-
ObjectType,
1312
ProtocolVersion,
1413
} from "@valkey/valkey-glide";
1514
import { v4 as uuidv4 } from "uuid";
@@ -24,6 +23,15 @@ import {
2423

2524
const TIMEOUT = 50000;
2625

26+
export enum ObjectType {
27+
STRING = "String",
28+
LIST = "List",
29+
SET = "Set",
30+
ZSET = "ZSet",
31+
HASH = "Hash",
32+
STREAM = "Stream",
33+
}
34+
2735
//cluster tests
2836
describe("Scan GlideClusterClient", () => {
2937
const testsFailed = 0;

node/tests/TestUtilities.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ export function checkFunctionListResponse(
484484
typeof libName === "string"
485485
? libName === lib["library_name"]
486486
: (libName as Buffer).compare(lib["library_name"] as Buffer) ==
487-
0;
487+
0;
488488

489489
if (hasLib) {
490490
const functions = lib["functions"];
@@ -537,7 +537,7 @@ export function checkFunctionStatsResponse(
537537
if (response.running_script !== null && runningFunction.length == 0) {
538538
fail(
539539
"Unexpected running function info: " +
540-
(response.running_script.command as string[]).join(" "),
540+
(response.running_script.command as string[]).join(" "),
541541
);
542542
}
543543

@@ -577,10 +577,10 @@ export function validateTransactionResponse(
577577
const actual =
578578
response?.[i] instanceof Map
579579
? JSON.stringify(
580-
Array.from(
581-
(response?.[i] as ReturnTypeMap)?.entries(),
582-
),
583-
)
580+
Array.from(
581+
(response?.[i] as ReturnTypeMap)?.entries(),
582+
),
583+
)
584584
: JSON.stringify(response?.[i]);
585585
failedChecks.push(
586586
`${testName} failed, expected <${expected}>, actual <${actual}>`,
@@ -591,7 +591,7 @@ export function validateTransactionResponse(
591591
if (failedChecks.length > 0) {
592592
throw new Error(
593593
"Checks failed in transaction response:\n" +
594-
failedChecks.join("\n"),
594+
failedChecks.join("\n"),
595595
);
596596
}
597597
}
@@ -1381,18 +1381,18 @@ export async function transactionTest(
13811381
'xautoclaim(key9, groupName1, consumer, 0, "0-0", { count: 1 })',
13821382
gte(version, "7.0.0")
13831383
? [
1384-
"0-0",
1385-
convertRecordToGlideRecord({
1386-
"0-2": [["field", "value2"]],
1387-
}),
1388-
[],
1389-
]
1384+
"0-0",
1385+
convertRecordToGlideRecord({
1386+
"0-2": [["field", "value2"]],
1387+
}),
1388+
[],
1389+
]
13901390
: [
1391-
"0-0",
1392-
convertRecordToGlideRecord({
1393-
"0-2": [["field", "value2"]],
1394-
}),
1395-
],
1391+
"0-0",
1392+
convertRecordToGlideRecord({
1393+
"0-2": [["field", "value2"]],
1394+
}),
1395+
],
13961396
]);
13971397
baseTransaction.xautoclaimJustId(key9, groupName1, consumer, 0, "0-0");
13981398
responseData.push([

0 commit comments

Comments
 (0)