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

DaniSomoza / galactic-commander / 12457084446

22 Dec 2024 07:29PM UTC coverage: 52.086% (-13.5%) from 65.587%
12457084446

Pull #11

github

web-flow
Merge 46f7a7895 into 4f9f087f0
Pull Request #11: Build units

206 of 790 branches covered (26.08%)

Branch coverage included in aggregate %.

366 of 893 new or added lines in 84 files covered. (40.99%)

10 existing lines in 7 files now uncovered.

1417 of 2326 relevant lines covered (60.92%)

3.83 hits per line

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

11.11
/packages/game-engine/src/engine/units/getFirstUnitInTheBuildQueue.ts
1
import { IPlanetDocument } from '../../models/PlanetModel'
2
import { IPlayerDocument } from '../../models/PlayerModel'
3
import { IUnitDocument } from '../../models/UnitModel'
4
import { BuildUnitsQueueType } from '../../types/IUnit'
5

6
function getFirstUnitInTheBuildQueue(
7
  player: IPlayerDocument,
8
  planet: IPlanetDocument,
9
  nextBuildUnits?: BuildUnitsQueueType
10
): IUnitDocument | undefined {
NEW
11
  if (nextBuildUnits) {
×
NEW
12
    const raceUnit = player.race.units.find((raceUnit) => raceUnit.name === nextBuildUnits.unitName)
×
NEW
13
    const specialPlanetUnit = planet.units.find(
×
NEW
14
      (planetUnit) => planetUnit.name === nextBuildUnits.unitName
×
15
    )
16

NEW
17
    return raceUnit || specialPlanetUnit
×
18
  }
19
}
20

21
export default getFirstUnitInTheBuildQueue
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