From 1bf84c24430bce4b4b8cab3692fb8b9353a20af3 Mon Sep 17 00:00:00 2001 From: Austin Rivas Date: Wed, 10 Oct 2018 02:20:10 -0400 Subject: [PATCH] added tests for main game loop --- test/main.test.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/main.test.ts diff --git a/test/main.test.ts b/test/main.test.ts new file mode 100644 index 0000000..caa7095 --- /dev/null +++ b/test/main.test.ts @@ -0,0 +1,25 @@ +import {assert} from "chai"; +import {loop} from "../src/main"; +import {Game, Memory} from "./mock" + +describe("main", () => { + before(() => { + // runs before all test in this block + }); + + beforeEach(() => { + // runs before each test in this block + // @ts-ignore : allow adding Game to global + global.Game = _.clone(Game); + // @ts-ignore : allow adding Memory to global + global.Memory = _.clone(Memory); + }); + + it("should export a loop function", () => { + assert.isTrue(typeof loop === "function"); + }); + + it("should return void when called with no context", () => { + assert.isUndefined(loop()); + }); +});