diff --git a/lib/core.ts b/lib/core.ts index d1620528..6e5aadc8 100644 --- a/lib/core.ts +++ b/lib/core.ts @@ -1,9 +1,9 @@ import { + BeforeApplicationShutdown, DynamicModule, FactoryProvider, Inject, Module, - OnApplicationShutdown, Provider, ValueProvider, } from "@nestjs/common"; @@ -23,7 +23,7 @@ import { } from "./interfaces"; @Module({}) -export class ObjectionCoreModule implements OnApplicationShutdown { +export class ObjectionCoreModule implements BeforeApplicationShutdown { constructor( @Inject(OBJECTION_MODULE_OPTIONS) private options: ObjectionModuleOptions, @@ -153,7 +153,7 @@ export class ObjectionCoreModule implements OnApplicationShutdown { }; } - async onApplicationShutdown(): Promise { + async beforeApplicationShutdown(): Promise { await this.disconnect(); } diff --git a/tests/constants.spec.ts b/tests/constants.spec.ts deleted file mode 100644 index 8c03e40a..00000000 --- a/tests/constants.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as constants from "../lib/constants"; - -describe("Constants", () => { - test("has 3", () => { - const expected = 3; - - expect(Object.keys(constants)).toHaveLength(expected); - }); -});