Compare commits
2 Commits
23bd432c5f
...
dcdbdd15ac
Author | SHA1 | Date | |
---|---|---|---|
dcdbdd15ac | |||
132b48cf2a |
@ -51,6 +51,9 @@ export abstract class RunnerGroup {
|
|||||||
*/
|
*/
|
||||||
@IsInt()
|
@IsInt()
|
||||||
public get distance(): number {
|
public get distance(): number {
|
||||||
|
if (!this.runners || this.runners.length == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return this.runners.reduce((sum, current) => sum + current.distance, 0);
|
return this.runners.reduce((sum, current) => sum + current.distance, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,8 +72,6 @@ describe('GET /api/stats/teams/* should return 200', () => {
|
|||||||
});
|
});
|
||||||
it('get by donations w/ auth should return 200', async () => {
|
it('get by donations w/ auth should return 200', async () => {
|
||||||
const res = await axios.get(base + '/api/stats/teams/donations', axios_config_stats);
|
const res = await axios.get(base + '/api/stats/teams/donations', axios_config_stats);
|
||||||
console.log("################# Teams by donations #################");
|
|
||||||
console.log(res.data);
|
|
||||||
expect(res.status).toEqual(200);
|
expect(res.status).toEqual(200);
|
||||||
expect(res.headers['content-type']).toContain("application/json");
|
expect(res.headers['content-type']).toContain("application/json");
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user