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

DaniSomoza / galactic-commander / 12728621970

11 Jan 2025 11:55PM UTC coverage: 47.963% (-4.1%) from 52.086%
12728621970

Pull #12

github

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

214 of 913 branches covered (23.44%)

Branch coverage included in aggregate %.

154 of 505 new or added lines in 55 files covered. (30.5%)

10 existing lines in 9 files now uncovered.

1564 of 2794 relevant lines covered (55.98%)

3.46 hits per line

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

50.0
/packages/game-engine/src/repositories/planetRepository.ts
1
import PlanetModel from '../models/PlanetModel'
4✔
2
import { IPlanet, IPlanetCoordinates } from '../types/IPlanet'
3

4
async function findPlanetById(planetId: string) {
5
  return PlanetModel.findById(planetId).exec()
×
6
}
7

8
async function findAvailablePrincipalPlanets() {
9
  return PlanetModel.find({
×
10
    isSpecial: false,
11
    isPrincipal: false,
12
    isExplored: false,
13
    isUnderConquer: false,
14
    ownerId: null
15
  }).exec()
16
}
17

18
async function findPlanetByCoordinates(coordinates: IPlanetCoordinates) {
19
  return PlanetModel.findOne({
26✔
20
    coordinates
21
  }).exec()
22
}
23

24
async function findPlanetsBySystem(galaxy: number, sector: number, system: number) {
NEW
25
  return PlanetModel.find({
×
26
    'coordinates.galaxy': galaxy,
27
    'coordinates.sector': sector,
28
    'coordinates.system': system
29
  }).exec()
30
}
31

32
async function insertPlanets(planets: IPlanet[]) {
33
  return PlanetModel.insertMany(planets)
×
34
}
35

36
const planetRepository = {
4✔
37
  findPlanetById,
38
  findPlanetByCoordinates,
39
  findAvailablePrincipalPlanets,
40
  findPlanetsBySystem,
41
  insertPlanets
42
}
43

44
export default planetRepository
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

© 2025 Coveralls, Inc