Function: mockBindService()
ts
function mockBindService<T>(
container: Container,
ServiceClass: Newable<T>,
options?: MockBindServiceOptions): void;Defined in: src/wirestate-core/test-utils/mock-bind-service.ts:41
Binds a service class to the IoC container for testing purposes.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends object | The type of the service being bound. |
Parameters
| Parameter | Type | Description |
|---|---|---|
container | Container | The Inversify Container to bind the service to. |
ServiceClass | Newable<T> | The service class constructor to bind. |
options | MockBindServiceOptions | Configuration options for the mock binding. |
Returns
void
Remarks
This utility is a testing wrapper for bindService. It ensures the service is correctly registered with singleton scope and lifecycle metadata.
Example
typescript
mockBindService(container, AnalyticsService);