Skip to content

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

Parameters

ParameterTypeDescription
containerContainerThe Inversify Container to bind the service to.
ServiceClassNewable<T>The service class constructor to bind.
optionsMockBindServiceOptionsConfiguration 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);