diff --git a/test/tests/main.js b/test/tests/main.js index 30f1d47..95305ac 100644 --- a/test/tests/main.js +++ b/test/tests/main.js @@ -16,4 +16,21 @@ $(document).ready(function() { assert.ok(salet.goTo(room.name), "Entered room "+room.name); } }); + QUnit.test("There are no game-breaking bugs in all actions.", function(assert) { + for (var key in salet.rooms) { + // skip loop if the property is from prototype + if (!salet.rooms.hasOwnProperty(key)) continue; + var room = salet.rooms[key]; + + salet.goTo(room.name); + for (var act in room.actions) { + if (!room.actions.hasOwnProperty(act)) continue; + assert.ok(act.fcall(room), "Executed action "+act); + } + for (var act in room.writers) { + if (!room.writers.hasOwnProperty(act)) continue; + assert.ok(act.fcall(room), "Executed action "+act); + } + } + }); });