Fix broken tests
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user