Fix broken tests

This commit is contained in:
Peter Stockings
2026-01-04 10:31:37 +11:00
parent f3607bc167
commit ace13377a2
2 changed files with 3 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ describe('World Generator', () => {
inventory: { gold: 0, items: [] }
};
const { world, playerId } = generateWorld(1, runState);
const { world } = generateWorld(1, runState);
// Should have player + enemies
expect(world.actors.size).toBeGreaterThan(1);

View File

@@ -35,7 +35,7 @@ describe('Combat Simulation', () => {
const events = applyAction(world, 1, { type: 'attack', targetId: 2 });
const enemy = world.actors.get(2)!;
expect(enemy.hp).toBeLessThan(10);
expect(enemy.stats!.hp).toBeLessThan(10);
// Should have attack event
expect(events.some(e => e.type === 'attacked')).toBe(true);
@@ -90,7 +90,7 @@ describe('Combat Simulation', () => {
});
const world = createTestWorld(actors);
const events = applyAction(world, 1, { type: 'attack', targetId: 2 });
applyAction(world, 1, { type: 'attack', targetId: 2 });
const enemy = world.actors.get(2)!;
const damage = 10 - enemy.stats!. hp;