Skip to content

Commit

Permalink
Clean up test files (reduce LoC)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamgrosset committed Feb 27, 2024
1 parent c3a2e42 commit a04df8b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
8 changes: 2 additions & 6 deletions src/main/contestants/team/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ describe('Team', () => {
let team: Team

beforeEach(() => {
const player1 = new Player('1', 1000)
const player2 = new Player('2', 900)

team = new Team('1')

team.addPlayer(player1)
team.addPlayer(player2)
team.addPlayer(new Player('1', 1000))
team.addPlayer(new Player('2', 900))
})

test('adds players to team', () => {
Expand Down
13 changes: 4 additions & 9 deletions src/main/matches/team-duel/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ describe('TeamDuel', () => {
let match: TeamDuel

beforeEach(() => {
const player1 = new Player('1', 1000)
const player2 = new Player('2', 900)
const player3 = new Player('3', 800)
const player4 = new Player('4', 700)
const team1 = new Team('1')
const team2 = new Team('2')

team1.addPlayer(player1)
team1.addPlayer(player2)
team2.addPlayer(player3)
team2.addPlayer(player4)
team1.addPlayer(new Player('1', 1000))
team1.addPlayer(new Player('2', 900))
team2.addPlayer(new Player('3', 800))
team2.addPlayer(new Player('4', 700))

match = new TeamDuel()

match.addTeam(team1)
match.addTeam(team2)
})
Expand Down
19 changes: 6 additions & 13 deletions src/main/matches/team-free-for-all/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,18 @@ describe('TeamFreeForAll', () => {
let match: TeamFreeForAll

beforeEach(() => {
const player1 = new Player('1', 1000)
const player2 = new Player('2', 900)
const player3 = new Player('3', 800)
const player4 = new Player('4', 700)
const player5 = new Player('5', 600)
const player6 = new Player('6', 500)
const team1 = new Team('1')
const team2 = new Team('2')
const team3 = new Team('3')

team1.addPlayer(player1)
team1.addPlayer(player2)
team2.addPlayer(player3)
team2.addPlayer(player4)
team3.addPlayer(player5)
team3.addPlayer(player6)
team1.addPlayer(new Player('1', 1000))
team1.addPlayer(new Player('2', 900))
team2.addPlayer(new Player('3', 800))
team2.addPlayer(new Player('4', 700))
team3.addPlayer(new Player('5', 600))
team3.addPlayer(new Player('6', 500))

match = new TeamFreeForAll()

match.addTeam(team1)
match.addTeam(team2)
match.addTeam(team3)
Expand Down

0 comments on commit a04df8b

Please sign in to comment.