Skip to content

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 ParameterDescription
T extends objectThe type of the service to unbind.

Parameters

ParameterTypeDescription
containerContainerThe Inversify Container to unbind from.
ServiceClassNewable<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);