Skip to content

Commit

Permalink
test: add test for LRAS winner
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceau committed Feb 3, 2023
1 parent 5b52b5a commit 22a48be
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/placings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ describe("when determining placings", () => {
expect(placements[3].position).toBe(null);
});

describe("when handling LRAS", () => {
it("should award the winner to the non-LRAS player", () => {
const game = new SlippiGame("slp/unranked_game1.slp");
const gameEnd = game.getGameEnd()!;
const winners = game.getWinners();
expect(winners).toHaveLength(1);
expect(winners[0].playerIndex).not.toEqual(gameEnd.lrasInitiatorIndex);
expect(winners[0].playerIndex).toEqual(1);
});
});

describe("when the game mode is Free for All", () => {
it("should find the winner", () => {
const game = new SlippiGame("slp/placementsTest/ffa_1p2p_winner_2p.slp");
Expand Down

0 comments on commit 22a48be

Please sign in to comment.