feat(companion): expose runtime event subscription count
This commit is contained in:
@@ -110,7 +110,9 @@ describe('CompanionRuntimeClient', () => {
|
||||
url: 'ws://127.0.0.1:1',
|
||||
});
|
||||
const handler = vi.fn();
|
||||
expect(client.eventSubscriptionCount).toBe(0);
|
||||
const unsubscribe = client.subscribeEvents(handler);
|
||||
expect(client.eventSubscriptionCount).toBe(1);
|
||||
|
||||
(client as unknown as { handleMessage: (raw: string) => void }).handleMessage(
|
||||
JSON.stringify({
|
||||
@@ -133,6 +135,7 @@ describe('CompanionRuntimeClient', () => {
|
||||
);
|
||||
|
||||
expect(handler).toHaveBeenCalledTimes(1);
|
||||
expect(client.eventSubscriptionCount).toBe(0);
|
||||
});
|
||||
|
||||
it('isolates subscriber callback failures', () => {
|
||||
|
||||
Reference in New Issue
Block a user