• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DaniSomoza / galactic-commander / 15029782185

14 May 2025 07:52PM UTC coverage: 47.664% (-4.4%) from 52.086%
15029782185

Pull #12

github

web-flow
Merge d58e631f3 into a8e301a23
Pull Request #12: [fleets] Explore planets

216 of 930 branches covered (23.23%)

Branch coverage included in aggregate %.

162 of 529 new or added lines in 56 files covered. (30.62%)

10 existing lines in 9 files now uncovered.

1569 of 2815 relevant lines covered (55.74%)

3.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/packages/game-engine/src/engine/fleets/getBaseFleetSpeed.ts
1
import { IFleetUnits } from '../../types/IFleet'
2
import getAmountOfStarFighters from './getAmountOfStarFighters'
4✔
3
import getFleetStarFighterCapacity from './getFleetStarFighterCapacity'
4✔
4

5
function getBaseFleetSpeed(units: IFleetUnits[]): number {
NEW
6
  const starFighterCapacity = getFleetStarFighterCapacity(units)
×
NEW
7
  const amountOfStarFighters = getAmountOfStarFighters(units)
×
8

NEW
9
  const spaceshipUnits = units.filter(({ unit }) => unit.type === 'SPACESHIP')
×
10

NEW
11
  if (starFighterCapacity > amountOfStarFighters) {
×
NEW
12
    const spaceshipUnitsWithoutStarFighters = spaceshipUnits.filter(
×
NEW
13
      ({ unit }) => unit.subtype !== 'STAR_FIGHTER'
×
14
    )
15

NEW
16
    return spaceshipUnitsWithoutStarFighters.reduce((fleetSpeed, { unit }) => {
×
NEW
17
      return fleetSpeed < unit.stats.speed ? fleetSpeed : unit.stats.speed
×
18
    }, spaceshipUnitsWithoutStarFighters[0].unit.stats.speed)
19
  }
20

NEW
21
  return spaceshipUnits.reduce((fleetSpeed, { unit }) => {
×
NEW
22
    return fleetSpeed < unit.stats.speed ? fleetSpeed : unit.stats.speed
×
23
  }, spaceshipUnits[0].unit.stats.speed)
24
}
25

26
export default getBaseFleetSpeed
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc