Skip to content

destroyInjector

@tsed/di

Usage ​

typescript
import { destroyInjector } from "@tsed/di";

See /packages/di/src/common/fn/injector.ts.

Overview ​

ts
function destroyInjector(): Promise<void>;

Description ​

Destroy the current injector and create a fresh instance.

Calls the destroy() lifecycle hook on all providers and resets the global injector. Primarily used in testing to reset the DI container between tests.

Released under the MIT License.