Skip to content

Commit

Permalink
Add test on monster names
Browse files Browse the repository at this point in the history
  • Loading branch information
pierpo committed Oct 16, 2018
1 parent 07cf38e commit 614db4c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/map.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const maps = require('../src/constants/maps').MAPS;
const scenes = require('../src/constants/scenes').SCENES;
const monsters = require('../src/constants/monsters').MONSTERS;
const sceneNames = Object.values(scenes);

const MANDATORY_LAYERS = ['terrain', 'deco', 'bridge', 'monsters', 'npcs', 'zones'];
Expand Down Expand Up @@ -44,6 +45,17 @@ describe('map', () => {
});
});
});

describe('monsters', () => {
it('should have only monsters declared in the constants', () => {
const monstersLayer = map.layers.find(o => o.name === 'monsters');
monstersLayer.objects.map(monster => {
const monsterName = monster.name;
expect(Object.values(monsters)).toContain(monsterName);
});
});
});

});
});
});

0 comments on commit 614db4c

Please sign in to comment.