Skip to content

Commit

Permalink
Update 100p FFA test
Browse files Browse the repository at this point in the history
  • Loading branch information
williamgrosset committed Feb 8, 2024
1 parent 21eb7a0 commit 329f810
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/matches/free-for-all/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,15 @@ describe('FreeForAll', () => {
match.addPlayer(new Player(i.toString(), 1000))
}

match.calculate(Array.from({ length: 100 }, (_, i) => (i + 1).toString()))

expect((match.contestants.get('1')! as Player).elo).toBe(1016)
expect((match.contestants.get('50')! as Player).elo).toBe(1000)
expect((match.contestants.get('55')! as Player).elo).toBe(998)
expect((match.contestants.get('100')! as Player).elo).toBe(984)
const results = match.calculate(
Array.from({ length: 100 }, (_, i) => (i + 1).toString())
)

expect((results[0] as Player).elo).toBe(1016)
expect((results[9] as Player).elo).toBe(1013)
expect((results[49] as Player).elo).toBe(1000)
expect((results[54] as Player).elo).toBe(998)
expect((results[99] as Player).elo).toBe(984)
})

test('throws error if trying to calculate when min players for match has not been reached', () => {
Expand Down

0 comments on commit 329f810

Please sign in to comment.