fix(companion): validate waitForIdle timeout option

This commit is contained in:
William Valentin
2026-02-16 20:57:34 -08:00
parent 1a46b122e0
commit 239d9f93ff
3 changed files with 26 additions and 1 deletions
+10
View File
@@ -661,6 +661,16 @@ describe('CompanionRuntimeClient', () => {
);
});
it('waitForIdle validates timeoutMs option', () => {
const client = new CompanionRuntimeClient({
url: 'ws://127.0.0.1:1',
});
expect(() => client.waitForIdle({ timeoutMs: 0 })).toThrow(
'timeoutMs must be a positive number',
);
});
it('waitForIdle resolves after pending event waiters are cleared', async () => {
const client = new CompanionRuntimeClient({
url: 'ws://127.0.0.1:1',