Fix typescript errors in tests

This commit is contained in:
Peter Stockings
2026-01-04 18:43:19 +11:00
parent 29e46093f5
commit 83b7f35e57
2 changed files with 15 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ describe('World Generator', () => {
describe('generateWorld', () => { describe('generateWorld', () => {
it('should generate a world with correct dimensions', () => { it('should generate a world with correct dimensions', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };
@@ -19,7 +19,7 @@ describe('World Generator', () => {
it('should place player actor', () => { it('should place player actor', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };
@@ -34,7 +34,7 @@ describe('World Generator', () => {
it('should create walkable rooms', () => { it('should create walkable rooms', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };
@@ -47,7 +47,7 @@ describe('World Generator', () => {
it('should place exit in valid location', () => { it('should place exit in valid location', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };
@@ -60,7 +60,7 @@ describe('World Generator', () => {
it('should create enemies', () => { it('should create enemies', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };
@@ -83,7 +83,7 @@ describe('World Generator', () => {
it('should generate deterministic maps for same level', () => { it('should generate deterministic maps for same level', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };
@@ -101,7 +101,7 @@ describe('World Generator', () => {
it('should generate different maps for different levels', () => { it('should generate different maps for different levels', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };
@@ -114,7 +114,7 @@ describe('World Generator', () => {
it('should scale enemy difficulty with level', () => { it('should scale enemy difficulty with level', () => {
const runState = { const runState = {
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 }, stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 },
inventory: { gold: 0, items: [] } inventory: { gold: 0, items: [] }
}; };

View File

@@ -20,7 +20,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 }, pos: { x: 3, y: 3 },
speed: 100, speed: 100,
energy: 0, energy: 0,
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 } stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
}); });
actors.set(2, { actors.set(2, {
id: 2, id: 2,
@@ -28,7 +28,7 @@ describe('Combat Simulation', () => {
pos: { x: 4, y: 3 }, pos: { x: 4, y: 3 },
speed: 100, speed: 100,
energy: 0, energy: 0,
stats: { maxHp: 10, hp: 10, attack: 3, defense: 1 } stats: { maxHp: 10, hp: 10, attack: 3, defense: 1, level: 1, exp: 0, expToNextLevel: 10 }
}); });
const world = createTestWorld(actors); const world = createTestWorld(actors);
@@ -49,7 +49,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 }, pos: { x: 3, y: 3 },
speed: 100, speed: 100,
energy: 0, energy: 0,
stats: { maxHp: 20, hp: 20, attack: 50, defense: 2 } stats: { maxHp: 20, hp: 20, attack: 50, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
}); });
actors.set(2, { actors.set(2, {
id: 2, id: 2,
@@ -57,7 +57,7 @@ describe('Combat Simulation', () => {
pos: { x: 4, y: 3 }, pos: { x: 4, y: 3 },
speed: 100, speed: 100,
energy: 0, energy: 0,
stats: { maxHp: 10, hp: 10, attack: 3, defense: 1 } stats: { maxHp: 10, hp: 10, attack: 3, defense: 1,level: 1, exp: 0, expToNextLevel: 10 }
}); });
const world = createTestWorld(actors); const world = createTestWorld(actors);
@@ -78,7 +78,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 }, pos: { x: 3, y: 3 },
speed: 100, speed: 100,
energy: 0, energy: 0,
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 } stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
}); });
actors.set(2, { actors.set(2, {
id: 2, id: 2,
@@ -86,7 +86,7 @@ describe('Combat Simulation', () => {
pos: { x: 4, y: 3 }, pos: { x: 4, y: 3 },
speed: 100, speed: 100,
energy: 0, energy: 0,
stats: { maxHp: 10, hp: 10, attack: 3, defense: 3 } stats: { maxHp: 10, hp: 10, attack: 3, defense: 3, level: 1, exp: 0, expToNextLevel: 10 }
}); });
const world = createTestWorld(actors); const world = createTestWorld(actors);
@@ -109,7 +109,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 }, pos: { x: 3, y: 3 },
speed: 100, speed: 100,
energy: 0, energy: 0,
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2 } stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
}); });
const world = createTestWorld(actors); const world = createTestWorld(actors);