-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
39 lines (33 loc) · 939 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const GameEngine = require("./core/GameEngine");
const game = new GameEngine();
const test = require("node:test");
test("Loading Game", (t) => {
// This test passes because it does not throw an exception.
game.loadGame("game/PrisonEscape/");
});
test("Run Game #1", (t) => {
// This test passes because it does not throw an exception.
game.look();
game.search("desk");
game.open("drawer");
game.take("keycell");
game.inventory();
game.sleep("bed");
});
test("Run Game #2", (t) => {
// This test passes because it does not throw an exception.
game.unlock("door_cell");
game.look();
game.search("guard");
game.take("key");
game.inventory();
game.unlock("door_corr");
});
test("Save Game", (t) => {
// This test passes because it does not throw an exception.
game.save("test");
});
test("Load Game", (t) => {
// This test passes because it does not throw an exception.
game.loadSave("test");
});