code quality

This commit is contained in:
2026-01-26 11:02:19 +01:00
parent afef777961
commit f877f821ef
14 changed files with 232 additions and 87 deletions

View File

@@ -14,19 +14,19 @@ describe('ChampionshipAggregator', () => {
const championship = {
id: 'champ-1',
dropScorePolicy: { strategy: 'none' },
} as any;
} as unknown as { id: string; dropScorePolicy: { strategy: string } };
const eventPointsByEventId = {
'event-1': [
{
participant: { id: 'p1', type: 'driver' },
{
participant: { id: 'p1', type: 'driver' },
totalPoints: 10,
basePoints: 10,
bonusPoints: 0,
penaltyPoints: 0
},
{
participant: { id: 'p2', type: 'driver' },
{
participant: { id: 'p2', type: 'driver' },
totalPoints: 20,
basePoints: 20,
bonusPoints: 0,
@@ -34,15 +34,15 @@ describe('ChampionshipAggregator', () => {
},
],
'event-2': [
{
participant: { id: 'p1', type: 'driver' },
{
participant: { id: 'p1', type: 'driver' },
totalPoints: 15,
basePoints: 15,
bonusPoints: 0,
penaltyPoints: 0
},
],
} as any;
} as unknown as Record<string, Array<{ participant: { id: string; type: string }; totalPoints: number; basePoints: number; bonusPoints: number; penaltyPoints: number }>>;
vi.mocked(mockDropScoreApplier.apply).mockImplementation((policy, events) => {
const total = events.reduce((sum, e) => sum + e.points, 0);