Fix tests

This commit is contained in:
Johannes Loher 2021-07-07 23:38:33 +02:00
parent 1099b1500e
commit c46c2c4a0a

View file

@ -5,7 +5,23 @@
import evaluateCheck from "../../src/module/rolls/check-evaluation"; 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", () => { describe("evaluateCheck with no dice", () => {
it("should throw an error.", () => { it("should throw an error.", () => {