blob: d11c262d0515500bef87bdb309d2d9d8c58f58f0 [file]
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { parseRuntimeHostCandidateArguments } from '../candidate-cli.js';
test('accepts an absolute legacy configuration root for the elected Candidate', () => {
assert.deepEqual(
parseRuntimeHostCandidateArguments([
'--root',
'/runtime-host-root',
'--expected-root-id',
'a'.repeat(64),
'--legacy-configuration-root',
'/legacy-configuration',
]),
{
rootPath: '/runtime-host-root',
expectedRootId: 'a'.repeat(64),
legacyConfigurationRoot: '/legacy-configuration',
idleGraceMs: undefined,
handshakeTimeoutMs: undefined,
},
);
assert.throws(
() =>
parseRuntimeHostCandidateArguments([
'--root',
'/runtime-host-root',
'--expected-root-id',
'a'.repeat(64),
'--legacy-configuration-root',
'relative/configuration',
]),
/Invalid --legacy-configuration-root/,
);
});