ad5e0815b6
Basically the same, except it plays nicer with Typescript and ESM. I have it mostly working, except for a type error: `TypeError: Int32Array is not a constructor` But I'm too damn tired it debug it at the moment.
33 lines
797 B
TypeScript
33 lines
797 B
TypeScript
import "reflect-metadata";
|
|
|
|
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");
|
|
});
|
|
|
|
afterEach(() =>
|
|
{
|
|
vi.restoreAllMocks();
|
|
});
|
|
|
|
describe("should be registered", () =>
|
|
{
|
|
it("should be registered", () =>
|
|
{
|
|
expect(paymentService).toBeDefined();
|
|
expect(container.isRegistered("PaymentService")).toBe(true);
|
|
});
|
|
});
|
|
});
|