Skip to content

Commit 5dbc781

Browse files
committed
Fixed nodes/add.test.ts
1 parent 0ae28ff commit 5dbc781

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/bin/nodes/CommandClaim.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ class CommandClaim extends CommandPolykey {
6868
binUtils.outputFormatter({
6969
type: options.format === 'json' ? 'json' : 'list',
7070
data: [
71-
`Successfully generated a cryptolink claim on Keynode with ID ${nodeId}`,
71+
`Successfully generated a cryptolink claim on Keynode with ID ${nodesUtils.encodeNodeId(
72+
nodeId,
73+
)}`,
7274
],
7375
}),
7476
);
@@ -77,7 +79,9 @@ class CommandClaim extends CommandPolykey {
7779
binUtils.outputFormatter({
7880
type: options.format === 'json' ? 'json' : 'list',
7981
data: [
80-
`Successfully sent Gestalt Invite notification to Keynode with ID ${nodeId}`,
82+
`Successfully sent Gestalt Invite notification to Keynode with ID ${nodesUtils.encodeNodeId(
83+
nodeId,
84+
)}`,
8185
],
8286
}),
8387
);

tests/bin/nodes/add.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ describe('add', () => {
9292
port.toString(),
9393
]);
9494
const result = await testBinUtils.pkStdio(commands, {}, dataDir);
95-
expect(result.exitCode).not.toBe(0);
96-
expect(result.stderr).toContain('Invalid node ID.');
95+
expect(result.exitCode).toBe(64);
9796
},
9897
global.failedConnectionTimeout,
9998
);
@@ -107,8 +106,7 @@ describe('add', () => {
107106
port.toString(),
108107
]);
109108
const result = await testBinUtils.pkStdio(commands, {}, dataDir);
110-
expect(result.exitCode).not.toBe(0);
111-
expect(result.stderr).toContain('Invalid IP address.');
109+
expect(result.exitCode).toBe(64);
112110

113111
// Checking if node was added.
114112
const res = await polykeyAgent.nodeManager.getNode(validNodeId);

0 commit comments

Comments
 (0)