Skip to content

Function: mockBindEntry()

ts
function mockBindEntry<T>(
   container: Container, 
   entry: 
  | InjectableDescriptor<unknown, unknown>
  | Newable<T>, 
   options?: MockBindEntryOptions): void;

Defined in: src/wirestate-core/test-utils/mock-bind-entry.ts:43

Binds a service entry 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 entry to.
entry| InjectableDescriptor<unknown, unknown> | Newable<T>The service class constructor or InjectableDescriptor to bind.
optionsMockBindEntryOptionsConfiguration options for the mock binding.

Returns

void

Remarks

This utility is a testing wrapper for bindEntry. It supports both service classes and InjectableDescriptor objects.

Example

typescript
mockBindEntry(container, UserService, { skipLifecycle: true });