fix(companion): validate event wait timeout options
This commit is contained in:
@@ -359,6 +359,9 @@ describe('CompanionRuntimeClient', () => {
|
||||
expect(() => client.waitForEvent(123 as unknown as string)).toThrow(
|
||||
'eventName must be a non-empty string',
|
||||
);
|
||||
expect(() => client.waitForEvent('agent.stream', { timeoutMs: 0 })).toThrow(
|
||||
'timeoutMs must be a positive number',
|
||||
);
|
||||
});
|
||||
|
||||
it('waitForEvent supports AbortSignal cancellation', async () => {
|
||||
@@ -600,6 +603,9 @@ describe('CompanionRuntimeClient', () => {
|
||||
expect(() => client.waitForAnyEvent(['agent.stream', 123 as unknown as string])).toThrow(
|
||||
'eventNames must not contain empty values',
|
||||
);
|
||||
expect(() => client.waitForAnyEvent(['agent.stream'], { timeoutMs: 0 })).toThrow(
|
||||
'timeoutMs must be a positive number',
|
||||
);
|
||||
});
|
||||
|
||||
it('tracks pendingRequestCount for in-flight RPCs', async () => {
|
||||
|
||||
Reference in New Issue
Block a user