test(api): update combat/equipment integration harness for HP vitals wiring
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { DataSource, EntityManager, EntityTarget } from 'typeorm';
|
import { DataSource, EntityManager, EntityTarget } from 'typeorm';
|
||||||
import { CharacterStatsService } from '../characters/character-stats.service';
|
import { CharacterStatsService } from '../characters/character-stats.service';
|
||||||
|
import { CharacterVitalsService } from '../characters/character-vitals.service';
|
||||||
import { Character } from '../characters/entities/character.entity';
|
import { Character } from '../characters/entities/character.entity';
|
||||||
import { CharacterEquipment } from '../equipment/entities/character-equipment.entity';
|
import { CharacterEquipment } from '../equipment/entities/character-equipment.entity';
|
||||||
import { EquipmentService } from '../equipment/equipment.service';
|
import { EquipmentService } from '../equipment/equipment.service';
|
||||||
@@ -170,6 +171,7 @@ function character(overrides: Partial<Character> = {}): Character {
|
|||||||
baseHp: 100,
|
baseHp: 100,
|
||||||
baseAttack: 6,
|
baseAttack: 6,
|
||||||
currentHp: 100,
|
currentHp: 100,
|
||||||
|
hpRegenSince: null,
|
||||||
currentLocationId: 'location-1',
|
currentLocationId: 'location-1',
|
||||||
createdAt: new Date('2026-08-18T09:00:00.000Z'),
|
createdAt: new Date('2026-08-18T09:00:00.000Z'),
|
||||||
updatedAt: new Date('2026-08-18T09:00:00.000Z'),
|
updatedAt: new Date('2026-08-18T09:00:00.000Z'),
|
||||||
@@ -302,13 +304,24 @@ function createHarness() {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
const dataSource = new FakeDataSource(state);
|
const dataSource = new FakeDataSource(state);
|
||||||
const characterStats = new CharacterStatsService(dataSource as unknown as DataSource);
|
const characterVitals = new CharacterVitalsService({
|
||||||
const equipmentService = new EquipmentService(dataSource as unknown as DataSource, characterStats);
|
now: () => new Date('2026-08-18T09:00:00.000Z'),
|
||||||
|
});
|
||||||
|
const characterStats = new CharacterStatsService(
|
||||||
|
dataSource as unknown as DataSource,
|
||||||
|
characterVitals,
|
||||||
|
);
|
||||||
|
const equipmentService = new EquipmentService(
|
||||||
|
dataSource as unknown as DataSource,
|
||||||
|
characterStats,
|
||||||
|
characterVitals,
|
||||||
|
);
|
||||||
const combatService = new CombatService(
|
const combatService = new CombatService(
|
||||||
dataSource as unknown as DataSource,
|
dataSource as unknown as DataSource,
|
||||||
fakeTravelService(),
|
fakeTravelService(),
|
||||||
new CombatEngineService(),
|
new CombatEngineService(),
|
||||||
characterStats,
|
characterStats,
|
||||||
|
characterVitals,
|
||||||
fakeRewardService(),
|
fakeRewardService(),
|
||||||
);
|
);
|
||||||
return { state, equipmentService, combatService };
|
return { state, equipmentService, combatService };
|
||||||
|
|||||||
Reference in New Issue
Block a user