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 Parameter | Description |
|---|---|
T extends object | The type of the service being bound. |
Parameters
| Parameter | Type | Description |
|---|---|---|
container | Container | The Inversify Container to bind the entry to. |
entry | | InjectableDescriptor<unknown, unknown> | Newable<T> | The service class constructor or InjectableDescriptor to bind. |
options | MockBindEntryOptions | Configuration 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 });