diff --git a/src/sim/catalog.ts b/src/sim/catalog.ts index 8e2780d..297ceff 100644 --- a/src/sim/catalog.ts +++ b/src/sim/catalog.ts @@ -30,7 +30,7 @@ export function createCatalog(games: Game[]): Catalog { const byId = new Map(); for (const g of games) { if (byId.has(g.id)) throw new Error(`Duplicate game id: ${g.id}`); - if (g.launchPriceCents <= 0) throw new Error(`Invalid launch price: ${g.id}`); + if (!(g.launchPriceCents > 0)) throw new Error(`Invalid launch price: ${g.id}`); byId.set(g.id, g); } return { games, byId }; diff --git a/tests/sim/transactions.test.ts b/tests/sim/transactions.test.ts index c2832a1..f7dab32 100644 --- a/tests/sim/transactions.test.ts +++ b/tests/sim/transactions.test.ts @@ -166,8 +166,9 @@ describe('requests', () => { recordSatisfiedRequest(s); expect(s.reputation).toBe(20.5); }); +}); -describe('review fixes', () => { +describe('reward and cash edge cases', () => { it('keeps the free trade reward when there is no difference to waive', () => { const s = createNewGame(1); const card = issueCard(s.loyalty); @@ -197,4 +198,3 @@ describe('review fixes', () => { expect(s.day.trades).toBe(0); }); }); -});