add integration testing support

This commit is contained in:
kaen
2018-11-10 15:49:43 -08:00
parent 1bf84c2443
commit f8507b632a
10 changed files with 219 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
import {assert} from "chai";
import {helper} from "./helper";
describe("main", () => {
it("runs a server and matches the game tick", async function () {
for (let i = 1; i < 10; i += 1) {
assert.equal(await helper.server.world.gameTime, i);
await helper.server.tick();
}
});
it("writes and reads to memory", async function () {
await helper.player.console(`Memory.foo = 'bar'`);
await helper.server.tick();
const memory = JSON.parse(await helper.player.memory);
assert.equal(memory.foo, 'bar');
});
});