From b31a48066b9bb02871f6b69773f1a9a1ad22631b Mon Sep 17 00:00:00 2001 From: TheSparta Date: Sat, 28 Oct 2023 20:40:11 +0100 Subject: [PATCH] Removed usage of `global.container` Importing container from tsyringe directly seems to work fine. --- project/tests/helpers/ItemHelper.test.ts | 5 +---- project/tests/services/PaymentService.test.ts | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/project/tests/helpers/ItemHelper.test.ts b/project/tests/helpers/ItemHelper.test.ts index 67821766..645fc47c 100644 --- a/project/tests/helpers/ItemHelper.test.ts +++ b/project/tests/helpers/ItemHelper.test.ts @@ -1,21 +1,18 @@ import "reflect-metadata"; - +import { container } from "tsyringe"; import { vi, beforeAll, afterEach, describe, expect, it } from "vitest"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { DependencyContainer } from "tsyringe"; import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { HashUtil } from "@spt-aki/utils/HashUtil"; describe("ItemHelper", () => { - let container: DependencyContainer; let itemHelper: ItemHelper; beforeAll(() => { - container = global.container; itemHelper = container.resolve("ItemHelper"); }); diff --git a/project/tests/services/PaymentService.test.ts b/project/tests/services/PaymentService.test.ts index 79a1456a..7b910179 100644 --- a/project/tests/services/PaymentService.test.ts +++ b/project/tests/services/PaymentService.test.ts @@ -1,18 +1,15 @@ import "reflect-metadata"; - +import { container } from "tsyringe"; import { vi, beforeAll, afterEach, describe, expect, it } from "vitest"; -import { DependencyContainer } from "tsyringe"; import { PaymentService } from "@spt-aki/services/PaymentService"; describe("PaymentService", () => { - let container: DependencyContainer; let paymentService: PaymentService; beforeAll(() => { - container = global.container; paymentService = container.resolve("PaymentService"); });