fix(companion): validate runtime and heartbeat loop options

This commit is contained in:
William Valentin
2026-02-16 18:47:43 -08:00
parent 873dc1ad5b
commit a5c5a320ca
5 changed files with 52 additions and 3 deletions
+9
View File
@@ -96,6 +96,15 @@ afterAll(async () => {
});
describe('CompanionRuntimeClient', () => {
it('validates requestTimeoutMs option', () => {
expect(() => {
new CompanionRuntimeClient({
url: 'ws://127.0.0.1:1',
requestTimeoutMs: 0,
});
}).toThrow('requestTimeoutMs must be a positive number');
});
it('dispatches gateway events to subscribed handlers and supports unsubscribe', () => {
const client = new CompanionRuntimeClient({
url: 'ws://127.0.0.1:1',