Removed usage of global.container

Importing container from tsyringe directly seems to work fine.
This commit is contained in:
TheSparta 2023-10-28 20:40:11 +01:00
parent ba32350751
commit b31a48066b
2 changed files with 2 additions and 8 deletions

View File

@ -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>("ItemHelper");
});

View File

@ -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>("PaymentService");
});