Use a class as the provider
The class will be registered as a singleton.
The class constructor to use as the provider
The parent TestingModuleBuilder for chaining
Use an existing token as the provider (alias)
The override token will resolve to the same instance as the target token.
The token to alias
The parent TestingModuleBuilder for chaining
Use a factory function as the provider
The factory receives the container and should return the provider instance.
The parent TestingModuleBuilder for chaining
Use a static value as the provider
The value will be registered directly in the container.
The value to use as the provider
The parent TestingModuleBuilder for chaining
Fluent builder for provider overrides
Provides a NestJS-style API for overriding providers in tests.
Example