From 38ff1d99ef4350f3c223d980acc5cfd67060f8b2 Mon Sep 17 00:00:00 2001 From: Eugene Daragan Date: Thu, 4 Apr 2024 18:18:05 +0200 Subject: [PATCH] tests --- test/dioma.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/dioma.test.ts b/test/dioma.test.ts index e1436eb..e16ff4b 100644 --- a/test/dioma.test.ts +++ b/test/dioma.test.ts @@ -1042,6 +1042,15 @@ describe("Dioma", () => { expect(instance).toBeInstanceOf(RegisterClass); }); + it("should throw when invalid descriptor is injected", () => { + const token = new Token(); + + // @ts-expect-error + globalContainer.register({ token, something: "invalid" }); + + expect(() => inject(token)).toThrowError(); + }); + it("should use registration scope if provided", () => { class RegisterClass { constructor() {}