fix(companion): type-guard event wait name validation
This commit is contained in:
@@ -350,6 +350,9 @@ describe('CompanionRuntimeClient', () => {
|
||||
|
||||
expect(() => client.waitForEvent('')).toThrow('eventName must be a non-empty string');
|
||||
expect(() => client.waitForEvent(' ')).toThrow('eventName must be a non-empty string');
|
||||
expect(() => client.waitForEvent(123 as unknown as string)).toThrow(
|
||||
'eventName must be a non-empty string',
|
||||
);
|
||||
});
|
||||
|
||||
it('waitForEvent supports AbortSignal cancellation', async () => {
|
||||
@@ -585,6 +588,9 @@ describe('CompanionRuntimeClient', () => {
|
||||
expect(() => client.waitForAnyEvent(['agent.stream', ' '])).toThrow(
|
||||
'eventNames must not contain empty values',
|
||||
);
|
||||
expect(() => client.waitForAnyEvent(['agent.stream', 123 as unknown as string])).toThrow(
|
||||
'eventNames must not contain empty values',
|
||||
);
|
||||
});
|
||||
|
||||
it('connects and performs node registration + capability discovery', async () => {
|
||||
|
||||
Reference in New Issue
Block a user