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

DaniSomoza / galactic-commander / 12422152220

19 Dec 2024 10:57PM UTC coverage: 52.396% (-13.2%) from 65.587%
12422152220

Pull #11

github

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

204 of 768 branches covered (26.56%)

Branch coverage included in aggregate %.

363 of 886 new or added lines in 84 files covered. (40.97%)

10 existing lines in 7 files now uncovered.

1414 of 2320 relevant lines covered (60.95%)

3.83 hits per line

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

40.0
/packages/game-api-microservice/src/utils/cleanUnitFields.ts
1
import { IUnitDocument } from 'game-engine/models/UnitModel'
2
import { IUnit } from 'game-engine/types/IUnit'
3

4
import { UnitType } from '../types/Unit'
5
import cleanResearchFields from './cleanResearchFields'
2✔
6

7
function cleanUnitFields(unit: IUnitDocument | IUnit): UnitType {
8
  const {
9
    name,
10
    description,
11

12
    raceName,
13

14
    type,
15
    subtype,
16

17
    resourceCost,
18
    energyCost,
19
    buildBaseTime,
20

21
    stats,
22

23
    isHero,
24
    isInvisible,
25
    isOrganic,
26
    isCapturable,
27
    isKamikaze,
28
    isAirborne,
29
    isSpecial,
30
    hasShieldPiercing,
31

32
    requirements,
33

34
    specials,
35

36
    bonus
NEW
37
  } = unit
×
38

NEW
39
  return {
×
40
    name,
41
    description,
42

43
    raceName,
44

45
    type,
46
    subtype,
47

48
    resourceCost,
49
    energyCost,
50
    buildBaseTime,
51

52
    stats,
53

54
    isHero,
55
    isInvisible,
56
    isOrganic,
57
    isCapturable,
58
    isKamikaze,
59
    isAirborne,
60
    isSpecial,
61
    hasShieldPiercing,
62

63
    requirements: {
NEW
64
      researches: requirements.researches.map((playerResearch) => ({
×
65
        research: cleanResearchFields(playerResearch.research),
66
        level: playerResearch.level
67
      }))
68
    },
69

70
    specials,
71

72
    bonus
73
  }
74
}
75

76
export default cleanUnitFields
2✔
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

© 2025 Coveralls, Inc