feat: Add event-based automation triggers (#2537)
This commit is contained in:
committed by
dermotduffy
parent
b701366762
commit
a31816c168
@@ -0,0 +1,14 @@
|
||||
import { vi } from 'vitest';
|
||||
import { mock, MockProxy } from 'vitest-mock-extended';
|
||||
import { SubscriptionHealthInterface } from '../../src/ha/connection/subscription-health-monitor';
|
||||
|
||||
// A benign mocked event-subscription health surface: no failures, listeners
|
||||
// return a no-op unsubscribe. Tests configure `getFailures`/`retry` as needed.
|
||||
export const createSubscriptionHealth = (): MockProxy<
|
||||
SubscriptionHealthInterface<string>
|
||||
> => {
|
||||
const health = mock<SubscriptionHealthInterface<string>>();
|
||||
health.getFailures.mockReturnValue([]);
|
||||
health.addListener.mockReturnValue(vi.fn());
|
||||
return health;
|
||||
};
|
||||
Reference in New Issue
Block a user