claude/fix-lint-errors-n48594 (#111)
All checks were successful
🚀 Deploy / 🧪 Test (push) Successful in 2m57s
🚀 Deploy / ʦ🔍 Typecheck & Lint (push) Successful in 1m21s
🚀 Deploy / 🐳 Build (push) Successful in 1m10s
🚀 Deploy / 🚀 Deploy (push) Successful in 10s

Co-authored-by: Claude <noreply@anthropic.com>
Reviewed-on: #111
This commit is contained in:
chrisp 2026-06-26 07:26:55 +00:00
parent ee099c64cd
commit 120056b0bd
4 changed files with 6 additions and 5 deletions

View file

@ -308,7 +308,7 @@ describe("resetCs2Event", () => {
const recalcCalls = vi.mocked(recalculateParticipantQP).mock.calls;
expect(recalcCalls).toHaveLength(2);
expect(recalcCalls.map((c) => c[0]).sort()).toEqual(["p1", "p2"]);
expect(recalcCalls.map((c) => c[0]).toSorted()).toEqual(["p1", "p2"]);
for (const call of recalcCalls) expect(call[1]).toBe("season-1");
});

View file

@ -675,7 +675,7 @@ export async function listSportsSeasonSimulatorSummaries(): Promise<SportsSeason
const simulatorType = (season.simulatorConfig?.simulatorType ?? season.sport.simulatorType) as SimulatorType;
const profile = await getSimulatorProfile(simulatorType);
const readiness = await validateSimulatorReadiness(season.id);
const mergedConfig = { ...profile.defaultConfig, ...(season.simulatorConfig?.config ?? {}) };
const mergedConfig = { ...profile.defaultConfig, ...season.simulatorConfig?.config };
const policy = getSimulatorInputPolicy(mergedConfig);
return {
sportsSeasonId: season.id,

View file

@ -221,10 +221,10 @@ describe("simulator input policy", () => {
expect(oddsOnly.get("longshot")?.method).toBe("sourceOdds");
// Between: a blend that sits strictly between the base and the odds-derived Elo.
const oddsElo = oddsOnly.get("favorite")!.sourceElo;
const oddsElo = oddsOnly.get("favorite")?.sourceElo ?? 0;
const blended = resolveSourceElos(inputs, profile, { inputPolicy: { oddsWeight: 0.5 } });
expect(blended.get("favorite")?.method).toBe("blend");
const blendedElo = blended.get("favorite")!.sourceElo;
const blendedElo = blended.get("favorite")?.sourceElo ?? 0;
expect(blendedElo).toBeGreaterThan(Math.min(1800, oddsElo));
expect(blendedElo).toBeLessThan(Math.max(1800, oddsElo));
expect(blendedElo).toBeCloseTo(Math.round(0.5 * 1800 + 0.5 * oddsElo), 0);

View file

@ -1,4 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import type * as SimulationsRegistry from "~/services/simulations/registry";
vi.mock("~/models/sports-season", () => ({
findSportsSeasonById: vi.fn(),
@ -24,7 +25,7 @@ vi.mock("~/models/scoring-calculator", () => ({
vi.mock("~/services/simulations/registry", async (importOriginal) => {
// Keep the real SIMULATOR_TYPES / getSimulatorInfo so the manifest (pulled in
// transitively via input-policy) can build; only stub getSimulator.
const actual = await importOriginal<typeof import("~/services/simulations/registry")>();
const actual = await importOriginal<typeof SimulationsRegistry>();
return { ...actual, getSimulator: vi.fn() };
});
vi.mock("~/services/simulations/simulation-probabilities", () => ({