Function: mockUnbindService()
ts
function mockUnbindService<T>(container: Container, ServiceClass: Newable<T>): void;Defined in: src/wirestate-core/test-utils/mock-unbind-service.ts:23
Unbinds a service from the IoC container.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends object | The type of the service to unbind. |
Parameters
| Parameter | Type | Description |
|---|---|---|
container | Container | The Inversify Container to unbind from. |
ServiceClass | Newable<T> | The service class constructor to unbind. |
Returns
void
Remarks
This is a convenience wrapper for container.unbind. It is useful in tests to reset or override specific service registrations between test cases.
Example
typescript
mockUnbindService(container, LegacyService);