feat(companion): add runtime bootstrapNode helper
This commit is contained in:
@@ -267,6 +267,36 @@ describe('CompanionRuntimeClient', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('bootstraps node registration and capabilities in one call', async () => {
|
||||
if (!LISTEN_ALLOWED) {
|
||||
return;
|
||||
}
|
||||
|
||||
const client = new CompanionRuntimeClient({
|
||||
url: `ws://127.0.0.1:${TEST_PORT}`,
|
||||
token: TEST_TOKEN,
|
||||
});
|
||||
await client.connect();
|
||||
|
||||
try {
|
||||
const boot = await client.bootstrapNode(
|
||||
{
|
||||
nodeId: 'bootstrap-runtime-node',
|
||||
role: 'companion',
|
||||
capabilities: ['ui.canvas'],
|
||||
},
|
||||
{ includeSystemCapabilities: true },
|
||||
);
|
||||
|
||||
expect(boot.register.registered).toBe(true);
|
||||
expect(boot.capabilities.node.id).toBe('bootstrap-runtime-node');
|
||||
expect(boot.systemCapabilities?.nodes.enabled).toBe(true);
|
||||
expect(boot.systemCapabilities?.nodes.registered).toBe(true);
|
||||
} finally {
|
||||
client.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
it('updates status/location/push and exposes them through system.nodes', async () => {
|
||||
if (!LISTEN_ALLOWED) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user