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

DaniSomoza / galactic-commander / 11940541664

20 Nov 2024 07:39PM UTC coverage: 65.587% (-31.2%) from 96.824%
11940541664

push

github

web-flow
Frontend initial implementation and player perks feature (#10)

* added vite react-ts template

* Add register and login pages

* Add initial frontend implementation

* Add first iteration of research queue

* first version of the research page

* added assets

* Added pirate research assets

* Added translation support

* updated planet images

* added first version of the bonus

181 of 418 branches covered (43.3%)

Branch coverage included in aggregate %.

532 of 983 new or added lines in 110 files covered. (54.12%)

8 existing lines in 4 files now uncovered.

1176 of 1651 relevant lines covered (71.23%)

4.75 hits per line

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

76.92
/packages/game-api-microservice/src/utils/cleanTaskFields.ts
1
import { ITaskDocument } from 'game-engine/models/TaskModel'
2

3
import { TaskType, TaskTypesTypes } from '../types/Task'
4

5
function cleanTaskFields(task: ITaskDocument): TaskType<TaskTypesTypes> {
6
  const {
7
    _id,
8
    type,
9
    data,
10
    universe,
11

12
    isCancellable,
13
    status,
14
    executeTaskAt,
15
    processedAt,
16
    processingDuration,
17
    history,
18
    errorDetails
19
  } = task
3✔
20

21
  return {
3✔
22
    taskId: _id.toString(),
23
    type,
24
    data: cleanTaskDataFields(data),
25
    universe: universe.toString(),
26

27
    isCancellable,
28
    status,
29
    executeTaskAt,
30
    processedAt,
31
    processingDuration,
32
    history,
33
    errorDetails
34
  }
35
}
36

37
export default cleanTaskFields
2✔
38

39
function cleanTaskDataFields(taskData: ITaskDocument['data']): TaskType<TaskTypesTypes>['data'] {
40
  // NewPlayerTaskType
41
  if ('username' in taskData) {
3✔
42
    const { username, email, race } = taskData
2✔
43
    return { username, email, race: race.toString() }
2✔
44
  }
45

46
  // FinishResearchTaskType
47
  if ('researchDuration' in taskData) {
1!
NEW
48
    const { player, research, researchDuration, researchResourceCost } = taskData
×
NEW
49
    return {
×
50
      player: player.toString(),
51
      research: research.toString(),
52
      researchDuration,
53
      researchResourceCost
54
    }
55
  }
56

57
  // StartResearchTaskType
58
  const { player, research } = taskData
1✔
59

60
  return { player: player.toString(), research: research.toString() }
1✔
61
}
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