Skip to content

Commit cbd1139

Browse files
committed
test creating cluster with --cluster_mode off
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
1 parent b4167ba commit cbd1139

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

node/tests/ServerModules.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import { ValkeyCluster } from "../../utils/TestUtils";
1414
import {
1515
flushAndCloseClient,
1616
getClientConfigurationOption,
17-
getServerVersion
17+
getServerVersion,
18+
parseCommandLineArgs,
19+
parseEndpoints,
1820
} from "./TestUtilities";
1921

2022
const TIMEOUT = 50000;
@@ -23,7 +25,14 @@ describe("GlideJson", () => {
2325
let cluster: ValkeyCluster;
2426
let client: GlideClusterClient;
2527
beforeAll(async () => {
26-
cluster = await ValkeyCluster.createCluster(false, 1, 1, getServerVersion);
28+
const clusterAddresses = parseCommandLineArgs()["cluster-endpoints"];
29+
cluster = clusterAddresses
30+
? await ValkeyCluster.initFromExistingCluster(
31+
false,
32+
parseEndpoints(clusterAddresses),
33+
getServerVersion,
34+
)
35+
: await ValkeyCluster.createCluster(false, 1, 1, getServerVersion);
2736
}, 20000);
2837

2938
afterEach(async () => {

0 commit comments

Comments
 (0)