refactor: update inline-schema to import accessors

This commit is contained in:
2026-04-15 14:56:48 +08:00
parent 7e98e5e546
commit 09148f5b13
12 changed files with 31 additions and 27 deletions
@@ -102,8 +102,8 @@ describe('encounterDesert.csv import', () => {
if (e.type === 'minion' || e.type === 'elite') {
expect(Array.isArray(e.enemies)).toBe(true);
expect(e.enemies.length).toBeGreaterThan(0);
for (const [enemyId, bonusHp] of e.enemies) {
expect(typeof enemyId).toBe('string');
for (const [enemy, bonusHp] of e.enemies) {
expect(typeof enemy === 'string' || typeof enemy === 'object').toBe(true);
expect(typeof bonusHp).toBe('number');
}
}
@@ -222,9 +222,9 @@ describe('enemyIntentDesert.csv import', () => {
it('should have effects with target, effect ref, and value', () => {
for (const intent of enemyIntentDesertData) {
for (const [target, effectId, value] of intent.effects) {
for (const [target, effect, value] of intent.effects) {
expect(target === 'self' || target === 'opponent').toBe(true);
expect(typeof effectId).toBe('string');
expect(typeof effect === 'string' || typeof effect === 'object').toBe(true);
expect(typeof value).toBe('number');
}
}