From 65202b2affbdf00e79e35e33f9c6e31a50fb432b Mon Sep 17 00:00:00 2001 From: Refringe Date: Mon, 6 Nov 2023 15:35:46 -0500 Subject: [PATCH] Remove the `resetAllMocks` call because `restoreAllMocks` does the same thing, plus restores the mocked method's original functionality. --- project/tests/CustomEnvironment.ts | 4 ++-- project/tests/controllers/InsuranceController.test.ts | 2 -- project/tests/generators/BotGenerator.test.ts | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/project/tests/CustomEnvironment.ts b/project/tests/CustomEnvironment.ts index f700cc61..1f50af92 100644 --- a/project/tests/CustomEnvironment.ts +++ b/project/tests/CustomEnvironment.ts @@ -11,7 +11,7 @@ import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ImporterUtil } from "@spt-aki/utils/ImporterUtil"; -//mocks +// Manually mock for the logger. import { WinstonLogger } from "@tests/__mocks__/WinstonLogger.mock"; export default { @@ -23,7 +23,7 @@ export default { Container.registerTypes(container); Container.registerListTypes(container); - // Override registration to the container + // Override registration to the container. container.register("WinstonLogger", WinstonLogger, { lifecycle: Lifecycle.Singleton }); // Import the database. diff --git a/project/tests/controllers/InsuranceController.test.ts b/project/tests/controllers/InsuranceController.test.ts index 2ba14de2..97db6a71 100644 --- a/project/tests/controllers/InsuranceController.test.ts +++ b/project/tests/controllers/InsuranceController.test.ts @@ -25,8 +25,6 @@ describe("InsuranceController", () => afterEach(() => { - // Restore all mocks to their original implementations. - vi.resetAllMocks(); vi.restoreAllMocks(); }); diff --git a/project/tests/generators/BotGenerator.test.ts b/project/tests/generators/BotGenerator.test.ts index a94f4b33..381189c9 100644 --- a/project/tests/generators/BotGenerator.test.ts +++ b/project/tests/generators/BotGenerator.test.ts @@ -16,8 +16,6 @@ describe("BotGenerator", () => afterEach(() => { - // Restore all mocks to their original implementations. - vi.resetAllMocks(); vi.restoreAllMocks(); });