From c46c2c4a0a03fe0e9b5a7011df979ffb3645aa59 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Wed, 7 Jul 2021 23:38:33 +0200 Subject: [PATCH] Fix tests --- spec/rolls/check-evaluation.spec.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/spec/rolls/check-evaluation.spec.ts b/spec/rolls/check-evaluation.spec.ts index f0c829a1..be26d9c6 100644 --- a/spec/rolls/check-evaluation.spec.ts +++ b/spec/rolls/check-evaluation.spec.ts @@ -5,7 +5,23 @@ import evaluateCheck from "../../src/module/rolls/check-evaluation"; -Object.defineProperty(globalThis, "game", { value: { i18n: { localize: (key: string) => key } } }); +class StubGame { + constructor() { + this.i18n = { + localize: (a: string) => a, + }; + } + i18n: { + localize: (a: string) => string; + }; +} + +const game = new StubGame(); + +Object.defineProperties(globalThis, { + game: { value: game }, + Game: { value: StubGame }, +}); describe("evaluateCheck with no dice", () => { it("should throw an error.", () => {