Skip to content

Commit 2a549b8

Browse files
committed
update expected output for LIST NODES command
1 parent 4f9d56d commit 2a549b8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/core.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,9 @@ describe.each([
435435
'LIST NODES',
436436
test(done, chinook, ok, {
437437
id: leader ?? expect.any(Number),
438-
node: leader ? parseconnectionstring(CHINOOK_DATABASE_URL).host + ':' + parseconnectionstring(CHINOOK_DATABASE_URL).port : expect.any(String),
439-
cluster: leader ? parseconnectionstring(CHINOOK_DATABASE_URL).host + ':9860' : expect.any(String),
438+
public_addr: leader ? parseconnectionstring(CHINOOK_DATABASE_URL).host : expect.any(String),
439+
port: leader ? parseconnectionstring(CHINOOK_DATABASE_URL).port : expect.any(String),
440+
cluster_port: leader ? '9860' : expect.any(String),
440441
status: leader ? 'Leader' : expect.any(String),
441442
progress: expect.any(String),
442443
match: expect.any(Number),
@@ -2308,12 +2309,12 @@ describe.skip.each([
23082309
})
23092310

23102311
describe.each([
2311-
[true, 2, '192.168.1.1:8860', '192.168.1.1:8860', true]
2312+
[true, 2, '192.168.1.1', '8860', '9860', true]
23122313
//[false, 0, '//', '//', false]
2313-
])('node', (learner, id, address, cluster, ok) => {
2314+
])('node', (learner, id, address, port, cluster_port, ok) => {
23142315
it(`should${ok ? '' : "n't"} add`, done => {
23152316
const chinook = getConnection()
2316-
chinook.sendCommands(`ADD${learner ? ' LEARNER' : ''} NODE ${id} ADDRESS ${address}${cluster ? ` CLUSTER ${cluster}` : ''}`, test(done, chinook, ok))
2317+
chinook.sendCommands(`ADD${learner ? ' LEARNER' : ''} NODE ${id} ADDRESS ${address}:${port} ${cluster_port ? ` CLUSTER ${address}:${cluster_port}` : ''}`, test(done, chinook, ok))
23172318
})
23182319

23192320
it(`should${ok ? '' : "n't"} list`, done => {
@@ -2322,8 +2323,9 @@ describe.each([
23222323
`LIST NODES`,
23232324
test(done, chinook, ok, {
23242325
id: id,
2325-
node: address,
2326-
cluster: cluster,
2326+
public_addr: address,
2327+
port: port,
2328+
cluster_port: cluster_port,
23272329
status: learner ? 'Learner' : 'Leader',
23282330
progress: expect.stringMatching(/(replicate|probe)/i),
23292331
match: expect.any(Number),

0 commit comments

Comments
 (0)