Add heartbeat telemetry support

This commit is contained in:
2026-09-19 21:52:05 -04:00
parent 8ac420fe61
commit ce0321a6e9
14 changed files with 63 additions and 21 deletions
+12
View File
@@ -43,6 +43,18 @@ async function records(guid = '2741626') {
}>;
}
it('refreshes stats during a round without adding rounds or completing the match', async () => {
await report('game_start');
await report('round_change', 30, [player(undefined, { kills: 100 })]);
await report('heartbeat', 30, [player(undefined, { kills: 150 })]);
await report('heartbeat', 30, [player(undefined, { kills: 150 })]);
expect(await matches()).toEqual([expect.objectContaining({ status: 'active', highest_round: 30 })]);
expect(await records()).toEqual([expect.objectContaining({ kills: 150, rounds_survived: 29, completed: 0 })]);
await report('game_end', 30);
await report('heartbeat', 30);
expect((await matches()).map(match => match.status)).toEqual(['completed', 'active']);
});
it('persists independent stat high-water marks without adding cumulative snapshots or retries', async () => {
await report('game_start');
await report('round_change', 1);