diff --git a/src/save-db.ts b/src/save-db.ts index d9a68c2..3c1a5ee 100644 --- a/src/save-db.ts +++ b/src/save-db.ts @@ -8,19 +8,28 @@ import { type SaveFile, validateSave } from "./saves"; /** An in-memory sql.js database produced from a `.cdb` save by `cdbToSql`. */ export type SaveDb = ReturnType; +/** Smallest plausible `YYYYMMDD` value (year 1000), used to reject sentinels. */ +const MIN_YMD = 10000000; + /** * Read the current in-game date from a save as a `YYYYMMDD` integer - * (e.g. `20260605`), or `null` when it can't be found. + * (e.g. `20260605`), or `null` when it can't be found or isn't a real date. * * PCM stores the career's current date in `GAM_config.gene_i_date`. It is the * reference point for any age- or season-relative computation, since the - * on-disk save advances as the career is played. + * on-disk save advances as the career is played. Fresh official releases that + * haven't started a career store `0` here; that sentinel is treated as "unknown" + * (returns `null`) so callers don't derive nonsensical ages from it. */ export function getGameDate(db: SaveDb): number | null { try { const result = db.exec("SELECT gene_i_date FROM GAM_config LIMIT 1"); const raw = result[0]?.values?.[0]?.[0]; - return raw != null ? Number(raw) : null; + if (raw == null) { + return null; + } + const value = Number(raw); + return Number.isFinite(value) && value >= MIN_YMD ? value : null; } catch { return null; } diff --git a/src/tools/get-team-roster.ts b/src/tools/get-team-roster.ts index 5c18988..060f095 100644 --- a/src/tools/get-team-roster.ts +++ b/src/tools/get-team-roster.ts @@ -155,8 +155,12 @@ export function registerGetTeamRoster(server: McpServer): void { stmt.bind({ ":teamId": resolvedTeamId }); while (stmt.step()) { const row = stmt.getAsObject(); - const birthdate = + const rawBirthdate = row.birthdate != null ? Number(row.birthdate) : null; + const birthdate = + rawBirthdate != null && rawBirthdate >= 10000000 + ? rawBirthdate + : null; cyclists.push({ id: Number(row.id), firstName: String(row.firstName), diff --git a/test/fixtures/OfficialRelease-2014.cdb b/test/fixtures/OfficialRelease-2014.cdb new file mode 100755 index 0000000..5c59cfe Binary files /dev/null and b/test/fixtures/OfficialRelease-2014.cdb differ diff --git a/test/fixtures/OfficialRelease-2018.cdb b/test/fixtures/OfficialRelease-2018.cdb new file mode 100755 index 0000000..c735fd5 Binary files /dev/null and b/test/fixtures/OfficialRelease-2018.cdb differ diff --git a/test/fixtures/OfficialRelease-2019.cdb b/test/fixtures/OfficialRelease-2019.cdb new file mode 100755 index 0000000..3b27014 Binary files /dev/null and b/test/fixtures/OfficialRelease-2019.cdb differ diff --git a/test/fixtures/OfficialRelease-2021.cdb b/test/fixtures/OfficialRelease-2021.cdb new file mode 100755 index 0000000..fbcc463 Binary files /dev/null and b/test/fixtures/OfficialRelease-2021.cdb differ diff --git a/test/fixtures/OfficialRelease-2025.cdb b/test/fixtures/OfficialRelease-2025.cdb new file mode 100755 index 0000000..71fdf79 Binary files /dev/null and b/test/fixtures/OfficialRelease-2025.cdb differ diff --git a/test/fixtures/save.fixture.ts b/test/fixtures/save.fixture.ts new file mode 100644 index 0000000..8e50462 --- /dev/null +++ b/test/fixtures/save.fixture.ts @@ -0,0 +1,28 @@ +import { fileURLToPath } from "node:url"; + +export const saveFixtures = [ + [ + "Pro cycling manager 2018", + fileURLToPath( + new URL("../fixtures/OfficialRelease-2018.cdb", import.meta.url), + ), + ], + [ + "Pro cycling manager 2019", + fileURLToPath( + new URL("../fixtures/OfficialRelease-2019.cdb", import.meta.url), + ), + ], + [ + "Pro cycling manager 2021", + fileURLToPath( + new URL("../fixtures/OfficialRelease-2021.cdb", import.meta.url), + ), + ], + [ + "Pro cycling manager 2025", + fileURLToPath( + new URL("../fixtures/OfficialRelease-2025.cdb", import.meta.url), + ), + ], +]; diff --git a/test/mocks/mock-mcp-server.ts b/test/mocks/mock-mcp-server.ts new file mode 100644 index 0000000..3e7610d --- /dev/null +++ b/test/mocks/mock-mcp-server.ts @@ -0,0 +1,75 @@ +import type { MockInstance } from "vitest"; +import { vi } from "vitest"; +import { + McpServer, + type ToolCallback, +} from "@modelcontextprotocol/sdk/server/mcp.js"; + +interface RegisteredTool { + name: string; + config: any; + callback: ToolCallback; +} + +export interface MockMcpServer { + /** The object to pass where an `McpServer` is expected. */ + server: McpServer; + /** Vitest spy behind `server.registerTool`, for call assertions. */ + registerTool: MockInstance; + /** Every tool registered so far, in registration order. */ + tools: RegisteredTool[]; + /** Look up a registered tool by its name. */ + getTool(name: string): RegisteredTool | undefined; + /** Invoke a registered tool's callback by name. */ + callTool( + name: string, + args: Record, + ): ReturnType>; +} + +/** + * Build a fake `McpServer` for unit tests. Only `registerTool` is implemented; + * it records each registration so tests can inspect the config or invoke the + * tool callback directly. + * + * @example + * const mcp = createMockMcpServer(); + * registerGetTableSchema(mcp.server); + * const result = await mcp.callTool("pcm_get_table_schema", { savePath, tableName }); + */ +export function createMockMcpServer(): MockMcpServer { + const tools: RegisteredTool[] = []; + + // A real `McpServer`, so no cast is needed to satisfy the tool + // registration functions. Only `registerTool` is exercised; spying on it + // records each registration and suppresses the real side effects. + const server = new McpServer({ name: "mock", version: "0.0.0" }); + + const registerTool = vi + .spyOn(server, "registerTool") + .mockImplementation((name, config, callback) => { + tools.push({ + name, + config, + callback: callback as ToolCallback, + }); + return {} as ReturnType; + }); + + const getTool = (name: string) => tools.find((t) => t.name === name); + + const callTool = (name: string, args: Record) => { + const tool = getTool(name); + if (!tool) { + throw new Error( + `Tool "${name}" was not registered. Registered: ${ + tools.map((t) => t.name).join(", ") || "(none)" + }`, + ); + } + // The second arg is the RequestHandlerExtra, unused by these tools. + return tool.callback(args as never, {} as any); + }; + + return { server, registerTool, tools, getTool, callTool }; +} diff --git a/test/save-db.test.ts b/test/save-db.test.ts index 20cca1e..fe152f4 100644 --- a/test/save-db.test.ts +++ b/test/save-db.test.ts @@ -18,7 +18,7 @@ import { withSaveDb } from "../src/save-db"; vi.mock("cdb-converter", () => ({ cdbToSql: vi.fn() })); vi.mock("sql.js", () => ({ default: vi.fn(() => ({})) })); -const cdbToSqlMock = cdbToSql as unknown as Mock; +const cdbToSqlMock = cdbToSql as Mock; let dir: string; let savePath: string; @@ -48,7 +48,9 @@ describe("withSaveDb", () => { }); it("passes the open database and save metadata to the callback", async () => { - const fn = vi.fn(() => ({ ok: true })); + const fn = vi.fn((_db: unknown, _save: { name: string; path: string }) => ({ + ok: true, + })); await withSaveDb(savePath, fn); @@ -76,7 +78,7 @@ describe("withSaveDb", () => { }); expect(result.isError).toBe(true); - expect(result.content[0].text).toContain("boom"); + expect((result.content[0] as { text: string }).text).toContain("boom"); expect(fakeDb.close).toHaveBeenCalledTimes(1); }); diff --git a/test/tools/__snapshots__/get-save-schema.test.ts.snap b/test/tools/__snapshots__/get-save-schema.test.ts.snap new file mode 100644 index 0000000..690e8e8 --- /dev/null +++ b/test/tools/__snapshots__/get-save-schema.test.ts.snap @@ -0,0 +1,2449 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`getSaveSchema > returns save schema for Pro cycling manager 2018 1`] = ` +{ + "tableCount": 150, + "tables": [ + { + "id": 2, + "name": "DYN_carac_evolution", + }, + { + "id": 3, + "name": "DYN_chrono_team_time_trial", + }, + { + "id": 4, + "name": "DYN_chrono_time_trial", + }, + { + "id": 5, + "name": "DYN_classification_race", + }, + { + "id": 6, + "name": "DYN_classification_stage", + }, + { + "id": 7, + "name": "DYN_classification_track", + }, + { + "id": 8, + "name": "DYN_coach", + }, + { + "id": 9, + "name": "DYN_contract_cyclist", + }, + { + "id": 10, + "name": "DYN_contract_cyclist_offer", + }, + { + "id": 11, + "name": "DYN_cyclist", + }, + { + "id": 12, + "name": "DYN_cyclist_season", + }, + { + "id": 14, + "name": "DYN_equipment_selection", + }, + { + "id": 16, + "name": "DYN_finance", + }, + { + "id": 17, + "name": "DYN_injury", + }, + { + "id": 18, + "name": "DYN_invitation_cyclist", + }, + { + "id": 19, + "name": "DYN_journalist_vote", + }, + { + "id": 20, + "name": "DYN_leader_program", + }, + { + "id": 22, + "name": "DYN_national_team", + }, + { + "id": 23, + "name": "DYN_news", + }, + { + "id": 24, + "name": "DYN_news_tag", + }, + { + "id": 25, + "name": "DYN_objectif", + }, + { + "id": 26, + "name": "DYN_palmares", + }, + { + "id": 27, + "name": "DYN_palmares_cyclist", + }, + { + "id": 28, + "name": "DYN_palmares_sponsor", + }, + { + "id": 29, + "name": "DYN_palmares_team", + }, + { + "id": 30, + "name": "DYN_physician", + }, + { + "id": 31, + "name": "DYN_race_status", + }, + { + "id": 35, + "name": "DYN_ranking", + }, + { + "id": 36, + "name": "DYN_scout", + }, + { + "id": 37, + "name": "DYN_scout_efficiency", + }, + { + "id": 38, + "name": "DYN_scout_mission", + }, + { + "id": 39, + "name": "DYN_simu_feedback", + }, + { + "id": 40, + "name": "DYN_sponsor", + }, + { + "id": 41, + "name": "DYN_sponsor_regions", + }, + { + "id": 42, + "name": "DYN_sponsor_research", + }, + { + "id": 43, + "name": "DYN_sponsor_results", + }, + { + "id": 44, + "name": "DYN_team", + }, + { + "id": 45, + "name": "DYN_team_race", + }, + { + "id": 46, + "name": "DYN_track_cyclist", + }, + { + "id": 47, + "name": "DYN_track_heat", + }, + { + "id": 48, + "name": "DYN_track_round", + }, + { + "id": 49, + "name": "DYN_track_series", + }, + { + "id": 50, + "name": "DYN_training_stage_TTT", + }, + { + "id": 51, + "name": "DYN_training_stage_bonus", + }, + { + "id": 52, + "name": "DYN_training_stage_booking", + }, + { + "id": 53, + "name": "DYN_training_stage_charac", + }, + { + "id": 54, + "name": "DYN_training_stage_recon", + }, + { + "id": 55, + "name": "DYN_transfer", + }, + { + "id": 59, + "name": "GAM_config", + }, + { + "id": 65, + "name": "GAM_user", + }, + { + "id": 77, + "name": "STA_UCI_class", + }, + { + "id": 78, + "name": "STA_bonus_UCI", + }, + { + "id": 79, + "name": "STA_bonus_superprestige", + }, + { + "id": 80, + "name": "STA_calendar", + }, + { + "id": 81, + "name": "STA_classification_source", + }, + { + "id": 82, + "name": "STA_classification_state", + }, + { + "id": 83, + "name": "STA_classification_type", + }, + { + "id": 84, + "name": "STA_climat", + }, + { + "id": 85, + "name": "STA_condition_type", + }, + { + "id": 86, + "name": "STA_contract_state", + }, + { + "id": 87, + "name": "STA_country", + }, + { + "id": 90, + "name": "STA_cyclist_future", + }, + { + "id": 91, + "name": "STA_cyclist_progression", + }, + { + "id": 92, + "name": "STA_cyclist_state", + }, + { + "id": 93, + "name": "STA_cyclist_statut", + }, + { + "id": 94, + "name": "STA_division", + }, + { + "id": 98, + "name": "STA_fame", + }, + { + "id": 99, + "name": "STA_filter_comparator_list", + }, + { + "id": 100, + "name": "STA_filter_field", + }, + { + "id": 101, + "name": "STA_filter_field_type", + }, + { + "id": 102, + "name": "STA_fitness_interval", + }, + { + "id": 103, + "name": "STA_fitness_program", + }, + { + "id": 104, + "name": "STA_fitness_program_week", + }, + { + "id": 107, + "name": "STA_handicap", + }, + { + "id": 108, + "name": "STA_injury", + }, + { + "id": 109, + "name": "STA_injury_label", + }, + { + "id": 110, + "name": "STA_invitation_state", + }, + { + "id": 111, + "name": "STA_jersey_colors", + }, + { + "id": 112, + "name": "STA_journal_title", + }, + { + "id": 113, + "name": "STA_journalist", + }, + { + "id": 117, + "name": "STA_news_type", + }, + { + "id": 118, + "name": "STA_objectif_type", + }, + { + "id": 119, + "name": "STA_palmares_type", + }, + { + "id": 120, + "name": "STA_program", + }, + { + "id": 121, + "name": "STA_program_info", + }, + { + "id": 122, + "name": "STA_race", + }, + { + "id": 124, + "name": "STA_race_rules", + }, + { + "id": 125, + "name": "STA_racefavorite_list", + }, + { + "id": 126, + "name": "STA_ranking_item", + }, + { + "id": 127, + "name": "STA_ranking_type", + }, + { + "id": 128, + "name": "STA_record_type", + }, + { + "id": 129, + "name": "STA_records", + }, + { + "id": 131, + "name": "STA_region", + }, + { + "id": 132, + "name": "STA_roster_listraces", + }, + { + "id": 133, + "name": "STA_roster_type_leader", + }, + { + "id": 134, + "name": "STA_simulate_order", + }, + { + "id": 135, + "name": "STA_simulate_status", + }, + { + "id": 136, + "name": "STA_simulate_tactic", + }, + { + "id": 137, + "name": "STA_stage", + }, + { + "id": 138, + "name": "STA_temperatures", + }, + { + "id": 142, + "name": "STA_training_exercise", + }, + { + "id": 143, + "name": "STA_training_stages", + }, + { + "id": 144, + "name": "STA_training_stages_massifs", + }, + { + "id": 145, + "name": "STA_training_stages_state", + }, + { + "id": 146, + "name": "STA_training_stages_type", + }, + { + "id": 147, + "name": "STA_trophy_prepoints", + }, + { + "id": 149, + "name": "STA_type_injury_origin", + }, + { + "id": 150, + "name": "STA_type_leader", + }, + { + "id": 151, + "name": "STA_type_leader_specialisation", + }, + { + "id": 152, + "name": "STA_type_rider", + }, + { + "id": 153, + "name": "STA_type_sprint", + }, + { + "id": 154, + "name": "STA_type_tour", + }, + { + "id": 155, + "name": "STA_user_state", + }, + { + "id": 156, + "name": "STA_utils", + }, + { + "id": 159, + "name": "SoundEvents", + }, + { + "id": 160, + "name": "TMP_listform", + }, + { + "id": 164, + "name": "DYN_cyclist_fitness", + }, + { + "id": 166, + "name": "DYN_cyclist_objective", + }, + { + "id": 168, + "name": "DYN_cyclist_satisfaction", + }, + { + "id": 169, + "name": "DYN_cyclist_fitness_data", + }, + { + "id": 170, + "name": "GAM_career_data", + }, + { + "id": 172, + "name": "STA_brand", + }, + { + "id": 173, + "name": "STA_brand_type", + }, + { + "id": 174, + "name": "STA_track_equipment", + }, + { + "id": 175, + "name": "STA_equipment_model", + }, + { + "id": 177, + "name": "DYN_equipment_techno", + }, + { + "id": 179, + "name": "DYN_brand_contract", + }, + { + "id": 180, + "name": "STA_equipment_template", + }, + { + "id": 181, + "name": "DYN_brand_offer", + }, + { + "id": 185, + "name": "DYN_coach_relation", + }, + { + "id": 186, + "name": "DYN_cyclist_progression", + }, + { + "id": 192, + "name": "DYN_u23_link", + }, + { + "id": 193, + "name": "DYN_scout_report", + }, + { + "id": 198, + "name": "STA_race_group", + }, + { + "id": 199, + "name": "DYN_cyclist_planning", + }, + { + "id": 200, + "name": "DYN_cyclist_peak_detail", + }, + { + "id": 201, + "name": "DYN_cyclist_training_plan", + }, + { + "id": 202, + "name": "DYN_fitness_recorded_data", + }, + { + "id": 203, + "name": "GAM_procyclist_data", + }, + { + "id": 204, + "name": "GAM_rewards_data", + }, + { + "id": 205, + "name": "INF_contract_preference_preset", + }, + { + "id": 206, + "name": "STA_race_pack", + }, + { + "id": 207, + "name": "DYN_transfer_available_cyclist", + }, + { + "id": 208, + "name": "DYN_transfer_team_wish", + }, + { + "id": 209, + "name": "STA_team_ridertype_distrib", + }, + { + "id": 210, + "name": "STA_team_ridertype_distrib_to_type_rider", + }, + { + "id": 211, + "name": "STA_team_ridertype_distrib_cat", + }, + { + "id": 212, + "name": "STA_regen_lastnameV2", + }, + { + "id": 213, + "name": "DYN_ui_planner_cyclist_sort", + }, + { + "id": 214, + "name": "DYN_cyclist_progression_dated", + }, + ], +} +`; + +exports[`getSaveSchema > returns save schema for Pro cycling manager 2019 1`] = ` +{ + "tableCount": 158, + "tables": [ + { + "id": 2, + "name": "DYN_carac_evolution", + }, + { + "id": 3, + "name": "DYN_chrono_team_time_trial", + }, + { + "id": 4, + "name": "DYN_chrono_time_trial", + }, + { + "id": 5, + "name": "DYN_classification_race", + }, + { + "id": 6, + "name": "DYN_classification_stage", + }, + { + "id": 7, + "name": "DYN_classification_track", + }, + { + "id": 8, + "name": "DYN_coach", + }, + { + "id": 9, + "name": "DYN_contract_cyclist", + }, + { + "id": 10, + "name": "DYN_contract_cyclist_offer", + }, + { + "id": 11, + "name": "DYN_cyclist", + }, + { + "id": 12, + "name": "DYN_cyclist_season", + }, + { + "id": 14, + "name": "DYN_equipment_selection", + }, + { + "id": 16, + "name": "DYN_finance", + }, + { + "id": 17, + "name": "DYN_injury", + }, + { + "id": 18, + "name": "DYN_invitation_cyclist", + }, + { + "id": 19, + "name": "DYN_journalist_vote", + }, + { + "id": 20, + "name": "DYN_leader_program", + }, + { + "id": 22, + "name": "DYN_national_team", + }, + { + "id": 23, + "name": "DYN_news", + }, + { + "id": 24, + "name": "DYN_news_tag", + }, + { + "id": 25, + "name": "DYN_objectif", + }, + { + "id": 26, + "name": "DYN_palmares", + }, + { + "id": 27, + "name": "DYN_palmares_cyclist", + }, + { + "id": 28, + "name": "DYN_palmares_sponsor", + }, + { + "id": 29, + "name": "DYN_palmares_team", + }, + { + "id": 30, + "name": "DYN_physician", + }, + { + "id": 31, + "name": "DYN_race_status", + }, + { + "id": 35, + "name": "DYN_ranking", + }, + { + "id": 36, + "name": "DYN_scout", + }, + { + "id": 37, + "name": "DYN_scout_efficiency", + }, + { + "id": 38, + "name": "DYN_scout_mission", + }, + { + "id": 39, + "name": "DYN_simu_feedback", + }, + { + "id": 40, + "name": "DYN_sponsor", + }, + { + "id": 41, + "name": "DYN_sponsor_regions", + }, + { + "id": 42, + "name": "DYN_sponsor_research", + }, + { + "id": 43, + "name": "DYN_sponsor_results", + }, + { + "id": 44, + "name": "DYN_team", + }, + { + "id": 45, + "name": "DYN_team_race", + }, + { + "id": 46, + "name": "DYN_track_cyclist", + }, + { + "id": 47, + "name": "DYN_track_heat", + }, + { + "id": 48, + "name": "DYN_track_round", + }, + { + "id": 49, + "name": "DYN_track_series", + }, + { + "id": 50, + "name": "DYN_training_stage_TTT", + }, + { + "id": 51, + "name": "DYN_training_stage_bonus", + }, + { + "id": 52, + "name": "DYN_training_stage_booking", + }, + { + "id": 53, + "name": "DYN_training_stage_charac", + }, + { + "id": 54, + "name": "DYN_training_stage_recon", + }, + { + "id": 55, + "name": "DYN_transfer", + }, + { + "id": 59, + "name": "GAM_config", + }, + { + "id": 65, + "name": "GAM_user", + }, + { + "id": 77, + "name": "STA_UCI_class", + }, + { + "id": 78, + "name": "STA_bonus_UCI", + }, + { + "id": 79, + "name": "STA_bonus_superprestige", + }, + { + "id": 80, + "name": "STA_calendar", + }, + { + "id": 81, + "name": "STA_classification_source", + }, + { + "id": 82, + "name": "STA_classification_state", + }, + { + "id": 83, + "name": "STA_classification_type", + }, + { + "id": 84, + "name": "STA_climat", + }, + { + "id": 85, + "name": "STA_condition_type", + }, + { + "id": 86, + "name": "STA_contract_state", + }, + { + "id": 87, + "name": "STA_country", + }, + { + "id": 90, + "name": "STA_cyclist_future", + }, + { + "id": 91, + "name": "STA_cyclist_progression", + }, + { + "id": 92, + "name": "STA_cyclist_state", + }, + { + "id": 93, + "name": "STA_cyclist_statut", + }, + { + "id": 94, + "name": "STA_division", + }, + { + "id": 98, + "name": "STA_fame", + }, + { + "id": 99, + "name": "STA_filter_comparator_list", + }, + { + "id": 100, + "name": "STA_filter_field", + }, + { + "id": 101, + "name": "STA_filter_field_type", + }, + { + "id": 102, + "name": "STA_fitness_interval", + }, + { + "id": 103, + "name": "STA_fitness_program", + }, + { + "id": 104, + "name": "STA_fitness_program_week", + }, + { + "id": 107, + "name": "STA_handicap", + }, + { + "id": 108, + "name": "STA_injury", + }, + { + "id": 109, + "name": "STA_injury_label", + }, + { + "id": 110, + "name": "STA_invitation_state", + }, + { + "id": 111, + "name": "STA_jersey_colors", + }, + { + "id": 112, + "name": "STA_journal_title", + }, + { + "id": 113, + "name": "STA_journalist", + }, + { + "id": 117, + "name": "STA_news_type", + }, + { + "id": 118, + "name": "STA_objectif_type", + }, + { + "id": 119, + "name": "STA_palmares_type", + }, + { + "id": 120, + "name": "STA_program", + }, + { + "id": 121, + "name": "STA_program_info", + }, + { + "id": 122, + "name": "STA_race", + }, + { + "id": 124, + "name": "STA_race_rules", + }, + { + "id": 125, + "name": "STA_racefavorite_list", + }, + { + "id": 126, + "name": "STA_ranking_item", + }, + { + "id": 127, + "name": "STA_ranking_type", + }, + { + "id": 128, + "name": "STA_record_type", + }, + { + "id": 129, + "name": "STA_records", + }, + { + "id": 131, + "name": "STA_region", + }, + { + "id": 132, + "name": "STA_roster_listraces", + }, + { + "id": 133, + "name": "STA_roster_type_leader", + }, + { + "id": 134, + "name": "STA_simulate_order", + }, + { + "id": 135, + "name": "STA_simulate_status", + }, + { + "id": 136, + "name": "STA_simulate_tactic", + }, + { + "id": 137, + "name": "STA_stage", + }, + { + "id": 138, + "name": "STA_temperatures", + }, + { + "id": 142, + "name": "STA_training_exercise", + }, + { + "id": 143, + "name": "STA_training_stages", + }, + { + "id": 144, + "name": "STA_training_stages_massifs", + }, + { + "id": 145, + "name": "STA_training_stages_state", + }, + { + "id": 146, + "name": "STA_training_stages_type", + }, + { + "id": 147, + "name": "STA_trophy_prepoints", + }, + { + "id": 149, + "name": "STA_type_injury_origin", + }, + { + "id": 150, + "name": "STA_type_leader", + }, + { + "id": 151, + "name": "STA_type_leader_specialisation", + }, + { + "id": 152, + "name": "STA_type_rider", + }, + { + "id": 153, + "name": "STA_type_sprint", + }, + { + "id": 154, + "name": "STA_type_tour", + }, + { + "id": 155, + "name": "STA_user_state", + }, + { + "id": 156, + "name": "STA_utils", + }, + { + "id": 159, + "name": "SoundEvents", + }, + { + "id": 160, + "name": "TMP_listform", + }, + { + "id": 164, + "name": "DYN_cyclist_fitness", + }, + { + "id": 166, + "name": "DYN_cyclist_objective", + }, + { + "id": 168, + "name": "DYN_cyclist_satisfaction", + }, + { + "id": 169, + "name": "DYN_cyclist_fitness_data", + }, + { + "id": 170, + "name": "GAM_career_data", + }, + { + "id": 172, + "name": "STA_brand", + }, + { + "id": 173, + "name": "STA_brand_type", + }, + { + "id": 174, + "name": "STA_track_equipment", + }, + { + "id": 175, + "name": "STA_equipment_model", + }, + { + "id": 177, + "name": "DYN_equipment_techno", + }, + { + "id": 179, + "name": "DYN_brand_contract", + }, + { + "id": 180, + "name": "STA_equipment_template", + }, + { + "id": 181, + "name": "DYN_brand_offer", + }, + { + "id": 185, + "name": "DYN_coach_relation", + }, + { + "id": 186, + "name": "DYN_cyclist_progression", + }, + { + "id": 192, + "name": "DYN_u23_link", + }, + { + "id": 193, + "name": "DYN_scout_report", + }, + { + "id": 198, + "name": "STA_race_group", + }, + { + "id": 199, + "name": "DYN_cyclist_planning", + }, + { + "id": 200, + "name": "DYN_cyclist_peak_detail", + }, + { + "id": 201, + "name": "DYN_cyclist_training_plan", + }, + { + "id": 202, + "name": "DYN_fitness_recorded_data", + }, + { + "id": 203, + "name": "GAM_procyclist_data", + }, + { + "id": 204, + "name": "GAM_rewards_data", + }, + { + "id": 205, + "name": "INF_contract_preference_preset", + }, + { + "id": 206, + "name": "STA_race_pack", + }, + { + "id": 207, + "name": "DYN_transfer_available_cyclist", + }, + { + "id": 208, + "name": "DYN_transfer_team_wish", + }, + { + "id": 209, + "name": "STA_team_ridertype_distrib", + }, + { + "id": 210, + "name": "STA_team_ridertype_distrib_to_type_rider", + }, + { + "id": 211, + "name": "STA_team_ridertype_distrib_cat", + }, + { + "id": 212, + "name": "STA_regen_lastnameV2", + }, + { + "id": 213, + "name": "DYN_ui_planner_cyclist_sort", + }, + { + "id": 214, + "name": "DYN_cyclist_progression_dated", + }, + { + "id": 215, + "name": "DYN_procyclist_skilltree", + }, + { + "id": 217, + "name": "STA_skilltree_branch", + }, + { + "id": 218, + "name": "DYN_procyclist", + }, + { + "id": 220, + "name": "DYN_procyclist_charac_history", + }, + { + "id": 221, + "name": "DYN_procyclist_contract_offer", + }, + { + "id": 223, + "name": "DYN_cyclist_fitpeak_history", + }, + { + "id": 224, + "name": "DYN_career_precontract_cyclist", + }, + { + "id": 225, + "name": "DYN_career_precontract_news", + }, + ], +} +`; + +exports[`getSaveSchema > returns save schema for Pro cycling manager 2021 1`] = ` +{ + "tableCount": 147, + "tables": [ + { + "id": 2, + "name": "DYN_carac_evolution", + }, + { + "id": 3, + "name": "DYN_chrono_team_time_trial", + }, + { + "id": 4, + "name": "DYN_chrono_time_trial", + }, + { + "id": 5, + "name": "DYN_classification_race", + }, + { + "id": 6, + "name": "DYN_classification_stage", + }, + { + "id": 7, + "name": "DYN_classification_track", + }, + { + "id": 8, + "name": "DYN_coach", + }, + { + "id": 9, + "name": "DYN_contract_cyclist", + }, + { + "id": 10, + "name": "DYN_contract_cyclist_offer", + }, + { + "id": 11, + "name": "DYN_cyclist", + }, + { + "id": 12, + "name": "DYN_cyclist_season", + }, + { + "id": 14, + "name": "DYN_equipment_selection", + }, + { + "id": 16, + "name": "DYN_finance", + }, + { + "id": 17, + "name": "DYN_injury", + }, + { + "id": 18, + "name": "DYN_invitation_cyclist", + }, + { + "id": 19, + "name": "DYN_journalist_vote", + }, + { + "id": 22, + "name": "DYN_national_team", + }, + { + "id": 23, + "name": "DYN_news", + }, + { + "id": 24, + "name": "DYN_news_tag", + }, + { + "id": 25, + "name": "DYN_objectif", + }, + { + "id": 26, + "name": "DYN_palmares", + }, + { + "id": 27, + "name": "DYN_palmares_cyclist", + }, + { + "id": 28, + "name": "DYN_palmares_sponsor", + }, + { + "id": 29, + "name": "DYN_palmares_team", + }, + { + "id": 30, + "name": "DYN_physician", + }, + { + "id": 31, + "name": "DYN_race_status", + }, + { + "id": 35, + "name": "DYN_ranking", + }, + { + "id": 36, + "name": "DYN_scout", + }, + { + "id": 39, + "name": "DYN_simu_feedback", + }, + { + "id": 40, + "name": "DYN_sponsor", + }, + { + "id": 41, + "name": "DYN_sponsor_regions", + }, + { + "id": 42, + "name": "DYN_sponsor_research", + }, + { + "id": 43, + "name": "DYN_sponsor_results", + }, + { + "id": 44, + "name": "DYN_team", + }, + { + "id": 45, + "name": "DYN_team_race", + }, + { + "id": 46, + "name": "DYN_track_cyclist", + }, + { + "id": 47, + "name": "DYN_track_heat", + }, + { + "id": 48, + "name": "DYN_track_round", + }, + { + "id": 49, + "name": "DYN_track_series", + }, + { + "id": 50, + "name": "DYN_training_stage_TTT", + }, + { + "id": 51, + "name": "DYN_training_stage_bonus", + }, + { + "id": 52, + "name": "DYN_training_stage_booking", + }, + { + "id": 53, + "name": "DYN_training_stage_charac", + }, + { + "id": 54, + "name": "DYN_training_stage_recon", + }, + { + "id": 55, + "name": "DYN_transfer", + }, + { + "id": 59, + "name": "GAM_config", + }, + { + "id": 65, + "name": "GAM_user", + }, + { + "id": 77, + "name": "STA_UCI_class", + }, + { + "id": 78, + "name": "STA_bonus_UCI", + }, + { + "id": 79, + "name": "STA_bonus_superprestige", + }, + { + "id": 80, + "name": "STA_calendar", + }, + { + "id": 81, + "name": "STA_classification_source", + }, + { + "id": 82, + "name": "STA_classification_state", + }, + { + "id": 83, + "name": "STA_classification_type", + }, + { + "id": 84, + "name": "STA_climat", + }, + { + "id": 85, + "name": "STA_condition_type", + }, + { + "id": 86, + "name": "STA_contract_state", + }, + { + "id": 87, + "name": "STA_country", + }, + { + "id": 92, + "name": "STA_cyclist_state", + }, + { + "id": 93, + "name": "STA_cyclist_statut", + }, + { + "id": 94, + "name": "STA_division", + }, + { + "id": 98, + "name": "STA_fame", + }, + { + "id": 99, + "name": "STA_filter_comparator_list", + }, + { + "id": 100, + "name": "STA_filter_field", + }, + { + "id": 101, + "name": "STA_filter_field_type", + }, + { + "id": 107, + "name": "STA_handicap", + }, + { + "id": 108, + "name": "STA_injury", + }, + { + "id": 109, + "name": "STA_injury_label", + }, + { + "id": 110, + "name": "STA_invitation_state", + }, + { + "id": 111, + "name": "STA_jersey_colors", + }, + { + "id": 112, + "name": "STA_journal_title", + }, + { + "id": 113, + "name": "STA_journalist", + }, + { + "id": 117, + "name": "STA_news_type", + }, + { + "id": 118, + "name": "STA_objectif_type", + }, + { + "id": 119, + "name": "STA_palmares_type", + }, + { + "id": 122, + "name": "STA_race", + }, + { + "id": 124, + "name": "STA_race_rules", + }, + { + "id": 125, + "name": "STA_racefavorite_list", + }, + { + "id": 126, + "name": "STA_ranking_item", + }, + { + "id": 127, + "name": "STA_ranking_type", + }, + { + "id": 128, + "name": "STA_record_type", + }, + { + "id": 129, + "name": "STA_records", + }, + { + "id": 131, + "name": "STA_region", + }, + { + "id": 132, + "name": "STA_roster_listraces", + }, + { + "id": 134, + "name": "STA_simulate_order", + }, + { + "id": 135, + "name": "STA_simulate_status", + }, + { + "id": 136, + "name": "STA_simulate_tactic", + }, + { + "id": 137, + "name": "STA_stage", + }, + { + "id": 142, + "name": "STA_training_exercise", + }, + { + "id": 143, + "name": "STA_training_stages", + }, + { + "id": 144, + "name": "STA_training_stages_massifs", + }, + { + "id": 145, + "name": "STA_training_stages_state", + }, + { + "id": 146, + "name": "STA_training_stages_type", + }, + { + "id": 147, + "name": "STA_trophy_prepoints", + }, + { + "id": 149, + "name": "STA_type_injury_origin", + }, + { + "id": 152, + "name": "STA_type_rider", + }, + { + "id": 153, + "name": "STA_type_sprint", + }, + { + "id": 155, + "name": "STA_user_state", + }, + { + "id": 159, + "name": "SoundEvents", + }, + { + "id": 164, + "name": "DYN_cyclist_fitness", + }, + { + "id": 166, + "name": "DYN_cyclist_objective", + }, + { + "id": 168, + "name": "DYN_cyclist_satisfaction", + }, + { + "id": 169, + "name": "DYN_cyclist_fitness_data", + }, + { + "id": 170, + "name": "GAM_career_data", + }, + { + "id": 172, + "name": "STA_brand", + }, + { + "id": 173, + "name": "STA_brand_type", + }, + { + "id": 174, + "name": "STA_track_equipment", + }, + { + "id": 175, + "name": "STA_equipment_model", + }, + { + "id": 177, + "name": "DYN_equipment_techno", + }, + { + "id": 179, + "name": "DYN_brand_contract", + }, + { + "id": 180, + "name": "STA_equipment_template", + }, + { + "id": 181, + "name": "DYN_brand_offer", + }, + { + "id": 185, + "name": "DYN_coach_relation", + }, + { + "id": 186, + "name": "DYN_cyclist_progression", + }, + { + "id": 192, + "name": "DYN_u23_link", + }, + { + "id": 193, + "name": "DYN_scout_report", + }, + { + "id": 200, + "name": "DYN_cyclist_peak_detail", + }, + { + "id": 201, + "name": "DYN_cyclist_training_plan", + }, + { + "id": 202, + "name": "DYN_fitness_recorded_data", + }, + { + "id": 203, + "name": "GAM_procyclist_data", + }, + { + "id": 204, + "name": "GAM_rewards_data", + }, + { + "id": 205, + "name": "INF_contract_preference_preset", + }, + { + "id": 206, + "name": "STA_race_pack", + }, + { + "id": 207, + "name": "DYN_transfer_available_cyclist", + }, + { + "id": 208, + "name": "DYN_transfer_team_wish", + }, + { + "id": 209, + "name": "STA_team_ridertype_distrib", + }, + { + "id": 210, + "name": "STA_team_ridertype_distrib_to_type_rider", + }, + { + "id": 211, + "name": "STA_team_ridertype_distrib_cat", + }, + { + "id": 213, + "name": "DYN_ui_planner_cyclist_sort", + }, + { + "id": 215, + "name": "DYN_procyclist_skilltree", + }, + { + "id": 217, + "name": "STA_skilltree_branch", + }, + { + "id": 218, + "name": "DYN_procyclist", + }, + { + "id": 220, + "name": "DYN_procyclist_charac_history", + }, + { + "id": 221, + "name": "DYN_procyclist_contract_offer", + }, + { + "id": 223, + "name": "DYN_cyclist_fitpeak_history", + }, + { + "id": 224, + "name": "DYN_career_precontract_cyclist", + }, + { + "id": 225, + "name": "DYN_career_precontract_news", + }, + { + "id": 228, + "name": "STA_impact_moral", + }, + { + "id": 229, + "name": "DYN_cyclist_impact_moral", + }, + { + "id": 230, + "name": "STA_trigger_impact_moral", + }, + { + "id": 231, + "name": "STA_trigger_moral", + }, + { + "id": 236, + "name": "STA_continent", + }, + { + "id": 240, + "name": "DYN_result_season", + }, + { + "id": 241, + "name": "DYN_cyclist_national_selection", + }, + { + "id": 242, + "name": "STA_national_team_invitation_state", + }, + { + "id": 244, + "name": "DYN_team_history", + }, + { + "id": 245, + "name": "STA_race_type", + }, + ], +} +`; + +exports[`getSaveSchema > returns save schema for Pro cycling manager 2025 1`] = ` +{ + "tableCount": 149, + "tables": [ + { + "id": 3, + "name": "DYN_chrono_team_time_trial", + }, + { + "id": 4, + "name": "DYN_chrono_time_trial", + }, + { + "id": 8, + "name": "DYN_coach", + }, + { + "id": 9, + "name": "DYN_contract_cyclist", + }, + { + "id": 10, + "name": "DYN_contract_cyclist_offer", + }, + { + "id": 11, + "name": "DYN_cyclist", + }, + { + "id": 12, + "name": "DYN_cyclist_season", + }, + { + "id": 14, + "name": "DYN_equipment_selection", + }, + { + "id": 16, + "name": "DYN_finance", + }, + { + "id": 17, + "name": "DYN_injury", + }, + { + "id": 18, + "name": "DYN_invitation_cyclist", + }, + { + "id": 19, + "name": "DYN_journalist_vote", + }, + { + "id": 22, + "name": "DYN_national_team", + }, + { + "id": 23, + "name": "DYN_news", + }, + { + "id": 24, + "name": "DYN_news_tag", + }, + { + "id": 25, + "name": "DYN_objectif", + }, + { + "id": 26, + "name": "DYN_palmares", + }, + { + "id": 27, + "name": "DYN_palmares_cyclist", + }, + { + "id": 28, + "name": "DYN_palmares_sponsor", + }, + { + "id": 29, + "name": "DYN_palmares_team", + }, + { + "id": 30, + "name": "DYN_physician", + }, + { + "id": 31, + "name": "DYN_race_status", + }, + { + "id": 35, + "name": "DYN_ranking", + }, + { + "id": 36, + "name": "DYN_scout", + }, + { + "id": 39, + "name": "DYN_simu_feedback", + }, + { + "id": 40, + "name": "DYN_sponsor", + }, + { + "id": 41, + "name": "DYN_sponsor_regions", + }, + { + "id": 44, + "name": "DYN_team", + }, + { + "id": 45, + "name": "DYN_team_race", + }, + { + "id": 50, + "name": "DYN_training_stage_TTT", + }, + { + "id": 51, + "name": "DYN_training_stage_bonus", + }, + { + "id": 52, + "name": "DYN_training_stage_booking", + }, + { + "id": 53, + "name": "DYN_training_stage_charac", + }, + { + "id": 54, + "name": "DYN_training_stage_recon", + }, + { + "id": 55, + "name": "DYN_transfer", + }, + { + "id": 59, + "name": "GAM_config", + }, + { + "id": 65, + "name": "GAM_user", + }, + { + "id": 80, + "name": "STA_calendar", + }, + { + "id": 81, + "name": "STA_classification_source", + }, + { + "id": 83, + "name": "STA_classification_type", + }, + { + "id": 84, + "name": "STA_climat", + }, + { + "id": 85, + "name": "STA_condition_type", + }, + { + "id": 86, + "name": "STA_contract_state", + }, + { + "id": 87, + "name": "STA_country", + }, + { + "id": 92, + "name": "STA_cyclist_state", + }, + { + "id": 93, + "name": "STA_cyclist_statut", + }, + { + "id": 94, + "name": "STA_division", + }, + { + "id": 98, + "name": "STA_fame", + }, + { + "id": 99, + "name": "STA_filter_comparator_list", + }, + { + "id": 100, + "name": "STA_filter_field", + }, + { + "id": 101, + "name": "STA_filter_field_type", + }, + { + "id": 107, + "name": "STA_handicap", + }, + { + "id": 108, + "name": "STA_injury", + }, + { + "id": 109, + "name": "STA_injury_label", + }, + { + "id": 110, + "name": "STA_invitation_state", + }, + { + "id": 111, + "name": "STA_jersey_colors", + }, + { + "id": 113, + "name": "STA_journalist", + }, + { + "id": 117, + "name": "STA_news_type", + }, + { + "id": 118, + "name": "STA_objectif_type", + }, + { + "id": 119, + "name": "STA_palmares_type", + }, + { + "id": 122, + "name": "STA_race", + }, + { + "id": 124, + "name": "STA_race_rules", + }, + { + "id": 125, + "name": "STA_racefavorite_list", + }, + { + "id": 126, + "name": "STA_ranking_item", + }, + { + "id": 127, + "name": "STA_ranking_type", + }, + { + "id": 128, + "name": "STA_record_type", + }, + { + "id": 129, + "name": "STA_records", + }, + { + "id": 131, + "name": "STA_region", + }, + { + "id": 132, + "name": "STA_roster_listraces", + }, + { + "id": 134, + "name": "STA_simulate_order", + }, + { + "id": 135, + "name": "STA_simulate_status", + }, + { + "id": 136, + "name": "STA_simulate_tactic", + }, + { + "id": 137, + "name": "STA_stage", + }, + { + "id": 142, + "name": "STA_training_exercise", + }, + { + "id": 143, + "name": "STA_training_stages", + }, + { + "id": 144, + "name": "STA_training_stages_massifs", + }, + { + "id": 145, + "name": "STA_training_stages_state", + }, + { + "id": 146, + "name": "STA_training_stages_type", + }, + { + "id": 147, + "name": "STA_trophy_prepoints", + }, + { + "id": 149, + "name": "STA_type_injury_origin", + }, + { + "id": 152, + "name": "STA_type_rider", + }, + { + "id": 153, + "name": "STA_type_sprint", + }, + { + "id": 155, + "name": "STA_user_state", + }, + { + "id": 159, + "name": "SoundEvents", + }, + { + "id": 164, + "name": "DYN_cyclist_fitness", + }, + { + "id": 166, + "name": "DYN_cyclist_objective", + }, + { + "id": 168, + "name": "DYN_cyclist_satisfaction", + }, + { + "id": 170, + "name": "GAM_career_data", + }, + { + "id": 172, + "name": "STA_brand", + }, + { + "id": 173, + "name": "STA_brand_type", + }, + { + "id": 175, + "name": "STA_equipment_model", + }, + { + "id": 177, + "name": "DYN_equipment_techno", + }, + { + "id": 179, + "name": "DYN_brand_contract", + }, + { + "id": 180, + "name": "STA_equipment_template", + }, + { + "id": 181, + "name": "DYN_brand_offer", + }, + { + "id": 185, + "name": "DYN_coach_relation", + }, + { + "id": 186, + "name": "DYN_cyclist_progression", + }, + { + "id": 192, + "name": "DYN_u23_link", + }, + { + "id": 193, + "name": "DYN_scout_report", + }, + { + "id": 200, + "name": "DYN_cyclist_peak_detail", + }, + { + "id": 202, + "name": "DYN_fitness_recorded_data", + }, + { + "id": 203, + "name": "GAM_procyclist_data", + }, + { + "id": 204, + "name": "GAM_rewards_data", + }, + { + "id": 205, + "name": "INF_contract_preference_preset", + }, + { + "id": 206, + "name": "STA_race_pack", + }, + { + "id": 207, + "name": "DYN_transfer_available_cyclist", + }, + { + "id": 208, + "name": "DYN_transfer_team_wish", + }, + { + "id": 209, + "name": "STA_team_ridertype_distrib", + }, + { + "id": 210, + "name": "STA_team_ridertype_distrib_to_type_rider", + }, + { + "id": 211, + "name": "STA_team_ridertype_distrib_cat", + }, + { + "id": 213, + "name": "DYN_ui_planner_cyclist_sort", + }, + { + "id": 215, + "name": "DYN_procyclist_skilltree", + }, + { + "id": 217, + "name": "STA_skilltree_branch", + }, + { + "id": 218, + "name": "DYN_procyclist", + }, + { + "id": 220, + "name": "DYN_procyclist_charac_history", + }, + { + "id": 221, + "name": "DYN_procyclist_contract_offer", + }, + { + "id": 223, + "name": "DYN_cyclist_fitpeak_history", + }, + { + "id": 224, + "name": "DYN_career_precontract_cyclist", + }, + { + "id": 225, + "name": "DYN_career_precontract_news", + }, + { + "id": 228, + "name": "STA_impact_moral", + }, + { + "id": 229, + "name": "DYN_cyclist_impact_moral", + }, + { + "id": 230, + "name": "STA_trigger_impact_moral", + }, + { + "id": 231, + "name": "STA_trigger_moral", + }, + { + "id": 236, + "name": "STA_continent", + }, + { + "id": 240, + "name": "DYN_result_season", + }, + { + "id": 241, + "name": "DYN_cyclist_national_selection", + }, + { + "id": 242, + "name": "STA_national_team_invitation_state", + }, + { + "id": 244, + "name": "DYN_team_history", + }, + { + "id": 245, + "name": "STA_race_type", + }, + { + "id": 246, + "name": "DYN_procyclist_teammate", + }, + { + "id": 249, + "name": "STA_territory", + }, + { + "id": 250, + "name": "DYN_cyclist_history", + }, + { + "id": 251, + "name": "DYN_championship_history", + }, + { + "id": 252, + "name": "STA_race_class", + }, + { + "id": 253, + "name": "DYN_ranking_race_points", + }, + { + "id": 254, + "name": "STA_race_bonus", + }, + { + "id": 255, + "name": "DYN_interruption", + }, + { + "id": 256, + "name": "STA_interruption_type", + }, + { + "id": 257, + "name": "DYN_ranking_history", + }, + { + "id": 258, + "name": "DYN_result_season_team", + }, + { + "id": 259, + "name": "DYN_result_season_stage", + }, + { + "id": 263, + "name": "DYN_investment_cyclist", + }, + { + "id": 264, + "name": "STA_investment_cyclist", + }, + { + "id": 265, + "name": "STA_investment_cyclist_type", + }, + { + "id": 266, + "name": "DYN_team_sponsor", + }, + { + "id": 268, + "name": "STA_business_line", + }, + { + "id": 270, + "name": "STA_world_range", + }, + { + "id": 273, + "name": "GAM_calendar_event", + }, + { + "id": 274, + "name": "DYN_sponsor_offer", + }, + ], +} +`; diff --git a/test/tools/__snapshots__/get-table-schema.test.ts.snap b/test/tools/__snapshots__/get-table-schema.test.ts.snap new file mode 100644 index 0000000..00874be --- /dev/null +++ b/test/tools/__snapshots__/get-table-schema.test.ts.snap @@ -0,0 +1,629 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`getTableSchema > returns STA_race table schema for Pro cycling manager 2018 1`] = ` +{ + "columnCount": 23, + "columns": [ + { + "name": "IDrace", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499717", + }, + { + "name": "gene_sz_race_name", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499730", + }, + { + "name": "gene_sz_abbreviation", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499762", + }, + { + "name": "gene_sz_filename", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499778", + }, + { + "name": "fkIDcountry", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499797", + }, + { + "name": "fkIDUCI_class", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499812", + }, + { + "name": "fkIDfirst_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499845", + }, + { + "name": "fkIDlast_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499861", + }, + { + "name": "gene_f_popularity", + "notNull": false, + "primaryKey": false, + "type": "REAL 499873", + }, + { + "name": "gene_i_number_stages", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499892", + }, + { + "name": "gene_sz_mailOrganisateur", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499922", + }, + { + "name": "gene_ilist_fkIDteam", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499947", + }, + { + "name": "gene_ilist_objectif_info", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500107", + }, + { + "name": "fkIDLastRaceLeader", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499957", + }, + { + "name": "CONSTANT", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499970", + }, + { + "name": "gene_sz_classification_xml", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500002", + }, + { + "name": "gene_f_organisateur_coeff", + "notNull": false, + "primaryKey": false, + "type": "REAL 500017", + }, + { + "name": "fkIDtype_tour", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500036", + }, + { + "name": "gene_b_ForceProtourInvitation", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500051", + }, + { + "name": "gene_b_aso", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500067", + }, + { + "name": "gene_sz_currentvariant", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500082", + }, + { + "name": "value_i_prime", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500112", + }, + { + "name": "gene_b_selected", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500131", + }, + ], + "name": "STA_race", + "rowCount": 254, +} +`; + +exports[`getTableSchema > returns STA_race table schema for Pro cycling manager 2019 1`] = ` +{ + "columnCount": 23, + "columns": [ + { + "name": "IDrace", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499717", + }, + { + "name": "gene_sz_race_name", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499730", + }, + { + "name": "gene_sz_abbreviation", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499762", + }, + { + "name": "gene_sz_filename", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499778", + }, + { + "name": "fkIDcountry", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499797", + }, + { + "name": "fkIDUCI_class", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499812", + }, + { + "name": "fkIDfirst_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499845", + }, + { + "name": "fkIDlast_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499861", + }, + { + "name": "gene_f_popularity", + "notNull": false, + "primaryKey": false, + "type": "REAL 499873", + }, + { + "name": "gene_i_number_stages", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499892", + }, + { + "name": "gene_sz_mailOrganisateur", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499922", + }, + { + "name": "gene_ilist_fkIDteam", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499947", + }, + { + "name": "gene_ilist_objectif_info", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500107", + }, + { + "name": "fkIDLastRaceLeader", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499957", + }, + { + "name": "CONSTANT", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499970", + }, + { + "name": "gene_sz_classification_xml", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500002", + }, + { + "name": "gene_f_organisateur_coeff", + "notNull": false, + "primaryKey": false, + "type": "REAL 500017", + }, + { + "name": "fkIDtype_tour", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500036", + }, + { + "name": "gene_b_ForceProtourInvitation", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500051", + }, + { + "name": "gene_b_aso", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500067", + }, + { + "name": "gene_sz_currentvariant", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500082", + }, + { + "name": "value_i_prime", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500112", + }, + { + "name": "gene_b_selected", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500131", + }, + ], + "name": "STA_race", + "rowCount": 263, +} +`; + +exports[`getTableSchema > returns STA_race table schema for Pro cycling manager 2021 1`] = ` +{ + "columnCount": 27, + "columns": [ + { + "name": "IDrace", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499717", + }, + { + "name": "gene_sz_race_name", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499730", + }, + { + "name": "gene_sz_abbreviation", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499762", + }, + { + "name": "gene_sz_filename", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499778", + }, + { + "name": "fkIDcountry", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499797", + }, + { + "name": "fkIDUCI_class", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499812", + }, + { + "name": "fkIDfirst_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499845", + }, + { + "name": "fkIDlast_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499861", + }, + { + "name": "gene_f_popularity", + "notNull": false, + "primaryKey": false, + "type": "REAL 499873", + }, + { + "name": "gene_i_number_stages", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499892", + }, + { + "name": "gene_sz_mailOrganisateur", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499922", + }, + { + "name": "gene_ilist_fkIDteam", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499947", + }, + { + "name": "gene_ilist_objectif_info", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500107", + }, + { + "name": "CONSTANT", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499970", + }, + { + "name": "gene_sz_classification_xml", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500002", + }, + { + "name": "gene_f_organisateur_coeff", + "notNull": false, + "primaryKey": false, + "type": "REAL 500017", + }, + { + "name": "fkIDrace_type", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500212", + }, + { + "name": "gene_b_national_tour", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500147", + }, + { + "name": "fkID_iconic_region", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500165", + }, + { + "name": "gene_i_comfort", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500180", + }, + { + "name": "gene_b_ForceProtourInvitation", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500051", + }, + { + "name": "gene_b_aso", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500067", + }, + { + "name": "gene_sz_currentvariant", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500082", + }, + { + "name": "value_i_prime", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500112", + }, + { + "name": "gene_b_selected", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500131", + }, + { + "name": "fkIDLastRaceLeader", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499957", + }, + { + "name": "value_i_offsetLeapYear", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500196", + }, + ], + "name": "STA_race", + "rowCount": 256, +} +`; + +exports[`getTableSchema > returns STA_race table schema for Pro cycling manager 2025 1`] = ` +{ + "columnCount": 25, + "columns": [ + { + "name": "IDrace", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499712", + }, + { + "name": "gene_sz_race_name", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499730", + }, + { + "name": "gene_sz_abbreviation", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499762", + }, + { + "name": "gene_sz_filename", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499778", + }, + { + "name": "fkIDcountry", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499792", + }, + { + "name": "fkIDrace_class", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500224", + }, + { + "name": "fkIDfirst_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499840", + }, + { + "name": "fkIDlast_stage", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499856", + }, + { + "name": "gene_f_popularity", + "notNull": false, + "primaryKey": false, + "type": "REAL 499873", + }, + { + "name": "gene_i_number_stages", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 499892", + }, + { + "name": "gene_sz_mailOrganisateur", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499922", + }, + { + "name": "gene_ilist_fkIDteam", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499947", + }, + { + "name": "gene_ilist_objectif_info", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500107", + }, + { + "name": "CONSTANT", + "notNull": false, + "primaryKey": false, + "type": "TEXT 499970", + }, + { + "name": "gene_sz_classification_xml", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500002", + }, + { + "name": "gene_f_organisateur_coeff", + "notNull": false, + "primaryKey": false, + "type": "REAL 500017", + }, + { + "name": "fkIDrace_type", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500208", + }, + { + "name": "gene_b_national_tour", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500147", + }, + { + "name": "fkID_iconic_region", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500160", + }, + { + "name": "gene_i_comfort", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500180", + }, + { + "name": "gene_b_aso", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500067", + }, + { + "name": "gene_sz_currentvariant", + "notNull": false, + "primaryKey": false, + "type": "TEXT 500082", + }, + { + "name": "value_i_prime", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500112", + }, + { + "name": "gene_b_selected", + "notNull": false, + "primaryKey": false, + "type": "NUMERIC 500131", + }, + { + "name": "value_i_offsetLeapYear", + "notNull": false, + "primaryKey": false, + "type": "INTEGER 500196", + }, + ], + "name": "STA_race", + "rowCount": 231, +} +`; diff --git a/test/tools/__snapshots__/get-team-roster.test.ts.snap b/test/tools/__snapshots__/get-team-roster.test.ts.snap new file mode 100644 index 0000000..405c556 --- /dev/null +++ b/test/tools/__snapshots__/get-team-roster.test.ts.snap @@ -0,0 +1,2841 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`getTeamRoster > returns the roster for a given team for Pro cycling manager 2018 1`] = ` +{ + "cyclists": [ + { + "acceleration": 73, + "age": null, + "baroudeur": 78, + "cobble": 72, + "contractEndYear": null, + "country": "CRC", + "downhilling": 75, + "endurance": 70, + "firstName": "Andrey", + "hill": 76, + "id": 432, + "lastName": "Amador", + "mediumMountain": null, + "mountain": 75, + "overall": null, + "plain": 73, + "prologue": 78, + "recuperation": 74, + "resistance": 71, + "sprint": 68, + "timeTrial": 75, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 70, + "cobble": 53, + "contractEndYear": null, + "country": "COL", + "downhilling": 64, + "endurance": 65, + "firstName": "Winner Andrew", + "hill": 74, + "id": 2693, + "lastName": "Anacona", + "mediumMountain": null, + "mountain": 75, + "overall": null, + "plain": 67, + "prologue": 63, + "recuperation": 70, + "resistance": 67, + "sprint": 57, + "timeTrial": 62, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 63, + "age": null, + "baroudeur": 64, + "cobble": 61, + "contractEndYear": null, + "country": "ESP", + "downhilling": 65, + "endurance": 64, + "firstName": "Jorge", + "hill": 65, + "id": 5630, + "lastName": "Arcas", + "mediumMountain": null, + "mountain": 63, + "overall": null, + "plain": 70, + "prologue": 71, + "recuperation": 66, + "resistance": 66, + "sprint": 65, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 76, + "age": null, + "baroudeur": 67, + "cobble": 61, + "contractEndYear": null, + "country": "ESP", + "downhilling": 68, + "endurance": 69, + "firstName": "Carlos", + "hill": 74, + "id": 2596, + "lastName": "Barbero", + "mediumMountain": null, + "mountain": 65, + "overall": null, + "plain": 73, + "prologue": 61, + "recuperation": 69, + "resistance": 68, + "sprint": 76, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 75, + "age": null, + "baroudeur": 67, + "cobble": 71, + "contractEndYear": null, + "country": "ITA", + "downhilling": 71, + "endurance": 72, + "firstName": "Daniele", + "hill": 73, + "id": 968, + "lastName": "Bennati", + "mediumMountain": null, + "mountain": 63, + "overall": null, + "plain": 74, + "prologue": 76, + "recuperation": 74, + "resistance": 72, + "sprint": 75, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 76, + "age": null, + "baroudeur": 70, + "cobble": 58, + "contractEndYear": null, + "country": "COL", + "downhilling": 71, + "endurance": 69, + "firstName": "Carlos Alberto", + "hill": 76, + "id": 2397, + "lastName": "Betancur", + "mediumMountain": null, + "mountain": 74, + "overall": null, + "plain": 66, + "prologue": 68, + "recuperation": 70, + "resistance": 69, + "sprint": 67, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 62, + "age": null, + "baroudeur": 69, + "cobble": 55, + "contractEndYear": null, + "country": "POR", + "downhilling": 64, + "endurance": 63, + "firstName": "Nuno", + "hill": 66, + "id": 3328, + "lastName": "Bico", + "mediumMountain": null, + "mountain": 62, + "overall": null, + "plain": 65, + "prologue": 61, + "recuperation": 67, + "resistance": 63, + "sprint": 59, + "timeTrial": 60, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 67, + "age": null, + "baroudeur": 66, + "cobble": 57, + "contractEndYear": null, + "country": "ECU", + "downhilling": 68, + "endurance": 69, + "firstName": "Richard", + "hill": 75, + "id": 5957, + "lastName": "Carapaz", + "mediumMountain": null, + "mountain": 78, + "overall": null, + "plain": 68, + "prologue": 64, + "recuperation": 71, + "resistance": 69, + "sprint": 58, + "timeTrial": 64, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 63, + "age": null, + "baroudeur": 64, + "cobble": 62, + "contractEndYear": null, + "country": "ESP", + "downhilling": 69, + "endurance": 61, + "firstName": "Héctor", + "hill": 64, + "id": 5956, + "lastName": "Carretero", + "mediumMountain": null, + "mountain": 63, + "overall": null, + "plain": 67, + "prologue": 66, + "recuperation": 63, + "resistance": 60, + "sprint": 60, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 58, + "age": null, + "baroudeur": 64, + "cobble": 62, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 68, + "endurance": 59, + "firstName": "Jaime", + "hill": 64, + "id": 6373, + "lastName": "Castrillo", + "mediumMountain": null, + "mountain": 64, + "overall": null, + "plain": 65, + "prologue": 67, + "recuperation": 64, + "resistance": 62, + "sprint": 57, + "timeTrial": 67, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 68, + "cobble": 57, + "contractEndYear": null, + "country": "ESP", + "downhilling": 70, + "endurance": 66, + "firstName": "Victor", + "hill": 72, + "id": 2474, + "lastName": "De La Parte", + "mediumMountain": null, + "mountain": 73, + "overall": null, + "plain": 70, + "prologue": 73, + "recuperation": 70, + "resistance": 66, + "sprint": 65, + "timeTrial": 72, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 64, + "age": null, + "baroudeur": 81, + "cobble": 75, + "contractEndYear": null, + "country": "ESP", + "downhilling": 72, + "endurance": 74, + "firstName": "Imanol", + "hill": 71, + "id": 783, + "lastName": "Erviti", + "mediumMountain": null, + "mountain": 64, + "overall": null, + "plain": 75, + "prologue": 71, + "recuperation": 62, + "resistance": 67, + "sprint": 61, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 67, + "age": null, + "baroudeur": 65, + "cobble": 55, + "contractEndYear": null, + "country": "ESP", + "downhilling": 67, + "endurance": 66, + "firstName": "Ruben", + "hill": 76, + "id": 3098, + "lastName": "Fernandez", + "mediumMountain": null, + "mountain": 74, + "overall": null, + "plain": 66, + "prologue": 65, + "recuperation": 67, + "resistance": 68, + "sprint": 60, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 75, + "age": null, + "baroudeur": 71, + "cobble": 61, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 75, + "endurance": 70, + "firstName": "Mikel", + "hill": 77, + "id": 1992, + "lastName": "Landa", + "mediumMountain": null, + "mountain": 82, + "overall": null, + "plain": 66, + "prologue": 69, + "recuperation": 78, + "resistance": 76, + "sprint": 57, + "timeTrial": 70, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 73, + "cobble": 73, + "contractEndYear": null, + "country": "POR", + "downhilling": 67, + "endurance": 70, + "firstName": "Nelson", + "hill": 71, + "id": 1975, + "lastName": "Oliveira", + "mediumMountain": null, + "mountain": 62, + "overall": null, + "plain": 74, + "prologue": 78, + "recuperation": 67, + "resistance": 68, + "sprint": 60, + "timeTrial": 78, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 61, + "age": null, + "baroudeur": 63, + "cobble": 54, + "contractEndYear": null, + "country": "ESP", + "downhilling": 63, + "endurance": 61, + "firstName": "Antonio", + "hill": 66, + "id": 5631, + "lastName": "Pedrero", + "mediumMountain": null, + "mountain": 68, + "overall": null, + "plain": 61, + "prologue": 61, + "recuperation": 64, + "resistance": 62, + "sprint": 55, + "timeTrial": 59, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 77, + "age": null, + "baroudeur": 65, + "cobble": 63, + "contractEndYear": 2019, + "country": "COL", + "downhilling": 76, + "endurance": 71, + "firstName": "Nairo", + "hill": 78, + "id": 2046, + "lastName": "Quintana", + "mediumMountain": null, + "mountain": 83, + "overall": null, + "plain": 68, + "prologue": 73, + "recuperation": 81, + "resistance": 76, + "sprint": 63, + "timeTrial": 71, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 68, + "age": null, + "baroudeur": 69, + "cobble": 63, + "contractEndYear": null, + "country": "COL", + "downhilling": 68, + "endurance": 67, + "firstName": "Dayer", + "hill": 73, + "id": 3383, + "lastName": "Quintana", + "mediumMountain": null, + "mountain": 75, + "overall": null, + "plain": 66, + "prologue": 61, + "recuperation": 69, + "resistance": 68, + "sprint": 57, + "timeTrial": 60, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 78, + "age": null, + "baroudeur": 59, + "cobble": 67, + "contractEndYear": null, + "country": "ESP", + "downhilling": 74, + "endurance": 70, + "firstName": "José Joaquin", + "hill": 75, + "id": 697, + "lastName": "Rojas", + "mediumMountain": null, + "mountain": 69, + "overall": null, + "plain": 73, + "prologue": 64, + "recuperation": 72, + "resistance": 70, + "sprint": 75, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 68, + "age": null, + "baroudeur": 70, + "cobble": 61, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 68, + "endurance": 67, + "firstName": "Jaime", + "hill": 75, + "id": 5684, + "lastName": "Roson", + "mediumMountain": null, + "mountain": 76, + "overall": null, + "plain": 68, + "prologue": 62, + "recuperation": 71, + "resistance": 70, + "sprint": 60, + "timeTrial": 60, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 69, + "cobble": 59, + "contractEndYear": 2019, + "country": "ARG", + "downhilling": 65, + "endurance": 64, + "firstName": "Eduardo", + "hill": 73, + "id": 3056, + "lastName": "Sepulveda", + "mediumMountain": null, + "mountain": 73, + "overall": null, + "plain": 67, + "prologue": 68, + "recuperation": 68, + "resistance": 66, + "sprint": 65, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 66, + "age": null, + "baroudeur": 73, + "cobble": 65, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 70, + "endurance": 70, + "firstName": "Marc", + "hill": 77, + "id": 3700, + "lastName": "Soler", + "mediumMountain": null, + "mountain": 78, + "overall": null, + "plain": 70, + "prologue": 73, + "recuperation": 73, + "resistance": 72, + "sprint": 60, + "timeTrial": 73, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 64, + "age": null, + "baroudeur": 71, + "cobble": 70, + "contractEndYear": null, + "country": "GER", + "downhilling": 71, + "endurance": 66, + "firstName": "Jasha", + "hill": 69, + "id": 2510, + "lastName": "Sütterlin", + "mediumMountain": null, + "mountain": 60, + "overall": null, + "plain": 74, + "prologue": 75, + "recuperation": 67, + "resistance": 66, + "sprint": 65, + "timeTrial": 76, + "type": null, + "value": 0, + "wage": null, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 67, + "cobble": 54, + "contractEndYear": 2018, + "country": "ESP", + "downhilling": 72, + "endurance": 66, + "firstName": "Rafael", + "hill": 76, + "id": 1919, + "lastName": "Valls", + "mediumMountain": null, + "mountain": 74, + "overall": null, + "plain": 67, + "prologue": 67, + "recuperation": 72, + "resistance": 68, + "sprint": 65, + "timeTrial": 63, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 78, + "age": null, + "baroudeur": 70, + "cobble": 68, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 75, + "endurance": 81, + "firstName": "Alejandro", + "hill": 82, + "id": 3, + "lastName": "Valverde", + "mediumMountain": null, + "mountain": 78, + "overall": null, + "plain": 72, + "prologue": 78, + "recuperation": 78, + "resistance": 80, + "sprint": 72, + "timeTrial": 72, + "type": null, + "value": 0, + "wage": 0, + }, + ], + "teamId": 1, +} +`; + +exports[`getTeamRoster > returns the roster for a given team for Pro cycling manager 2019 1`] = ` +{ + "cyclists": [ + { + "acceleration": 73, + "age": null, + "baroudeur": 78, + "cobble": 72, + "contractEndYear": 2019, + "country": "CRC", + "downhilling": 75, + "endurance": 70, + "firstName": "Andrey", + "hill": 75, + "id": 432, + "lastName": "Amador", + "mediumMountain": null, + "mountain": 76, + "overall": null, + "plain": 72, + "prologue": 78, + "recuperation": 72, + "resistance": 71, + "sprint": 68, + "timeTrial": 75, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 70, + "cobble": 57, + "contractEndYear": 2019, + "country": "COL", + "downhilling": 64, + "endurance": 67, + "firstName": "Winner Andrew", + "hill": 73, + "id": 2693, + "lastName": "Anacona", + "mediumMountain": null, + "mountain": 74, + "overall": null, + "plain": 66, + "prologue": 63, + "recuperation": 70, + "resistance": 68, + "sprint": 57, + "timeTrial": 62, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 67, + "age": null, + "baroudeur": 64, + "cobble": 62, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 65, + "endurance": 63, + "firstName": "Jorge", + "hill": 67, + "id": 5630, + "lastName": "Arcas", + "mediumMountain": null, + "mountain": 61, + "overall": null, + "plain": 71, + "prologue": 71, + "recuperation": 66, + "resistance": 65, + "sprint": 69, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 76, + "age": null, + "baroudeur": 67, + "cobble": 62, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 68, + "endurance": 70, + "firstName": "Carlos", + "hill": 74, + "id": 2596, + "lastName": "Barbero", + "mediumMountain": null, + "mountain": 65, + "overall": null, + "plain": 73, + "prologue": 61, + "recuperation": 69, + "resistance": 69, + "sprint": 76, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 71, + "age": null, + "baroudeur": 67, + "cobble": 71, + "contractEndYear": 2019, + "country": "ITA", + "downhilling": 71, + "endurance": 72, + "firstName": "Daniele", + "hill": 72, + "id": 968, + "lastName": "Bennati", + "mediumMountain": null, + "mountain": 63, + "overall": null, + "plain": 74, + "prologue": 76, + "recuperation": 74, + "resistance": 72, + "sprint": 72, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 76, + "age": null, + "baroudeur": 70, + "cobble": 60, + "contractEndYear": 2019, + "country": "COL", + "downhilling": 71, + "endurance": 69, + "firstName": "Carlos Alberto", + "hill": 76, + "id": 2397, + "lastName": "Betancur", + "mediumMountain": null, + "mountain": 74, + "overall": null, + "plain": 68, + "prologue": 68, + "recuperation": 70, + "resistance": 69, + "sprint": 67, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 67, + "age": null, + "baroudeur": 69, + "cobble": 59, + "contractEndYear": 2019, + "country": "ECU", + "downhilling": 73, + "endurance": 71, + "firstName": "Richard", + "hill": 78, + "id": 5957, + "lastName": "Carapaz", + "mediumMountain": null, + "mountain": 81, + "overall": null, + "plain": 71, + "prologue": 66, + "recuperation": 78, + "resistance": 73, + "sprint": 57, + "timeTrial": 64, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 64, + "cobble": 60, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 69, + "endurance": 61, + "firstName": "Héctor", + "hill": 69, + "id": 5956, + "lastName": "Carretero", + "mediumMountain": null, + "mountain": 66, + "overall": null, + "plain": 69, + "prologue": 66, + "recuperation": 63, + "resistance": 60, + "sprint": 60, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 58, + "age": null, + "baroudeur": 64, + "cobble": 61, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 68, + "endurance": 59, + "firstName": "Jaime", + "hill": 64, + "id": 6373, + "lastName": "Castrillo", + "mediumMountain": null, + "mountain": 64, + "overall": null, + "plain": 65, + "prologue": 67, + "recuperation": 64, + "resistance": 62, + "sprint": 57, + "timeTrial": 67, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 64, + "age": null, + "baroudeur": 81, + "cobble": 74, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 72, + "endurance": 74, + "firstName": "Imanol", + "hill": 71, + "id": 783, + "lastName": "Erviti", + "mediumMountain": null, + "mountain": 64, + "overall": null, + "plain": 75, + "prologue": 71, + "recuperation": 62, + "resistance": 67, + "sprint": 61, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 67, + "age": null, + "baroudeur": 65, + "cobble": 58, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 67, + "endurance": 66, + "firstName": "Ruben", + "hill": 74, + "id": 3098, + "lastName": "Fernandez", + "mediumMountain": null, + "mountain": 72, + "overall": null, + "plain": 68, + "prologue": 65, + "recuperation": 67, + "resistance": 68, + "sprint": 60, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 74, + "age": null, + "baroudeur": 75, + "cobble": 69, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 75, + "endurance": 72, + "firstName": "Mikel", + "hill": 77, + "id": 1992, + "lastName": "Landa", + "mediumMountain": null, + "mountain": 82, + "overall": null, + "plain": 66, + "prologue": 69, + "recuperation": 77, + "resistance": 73, + "sprint": 57, + "timeTrial": 70, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 82, + "cobble": 61, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 71, + "endurance": 65, + "firstName": "Luis", + "hill": 70, + "id": 2006, + "lastName": "Mas Bonet", + "mediumMountain": null, + "mountain": 66, + "overall": null, + "plain": 73, + "prologue": 68, + "recuperation": 68, + "resistance": 66, + "sprint": 65, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 73, + "cobble": 73, + "contractEndYear": 2019, + "country": "POR", + "downhilling": 67, + "endurance": 70, + "firstName": "Nelson", + "hill": 71, + "id": 1975, + "lastName": "Oliveira", + "mediumMountain": null, + "mountain": 62, + "overall": null, + "plain": 74, + "prologue": 78, + "recuperation": 67, + "resistance": 68, + "sprint": 60, + "timeTrial": 78, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 62, + "age": null, + "baroudeur": 63, + "cobble": 57, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 70, + "endurance": 64, + "firstName": "Antonio", + "hill": 71, + "id": 5631, + "lastName": "Pedrero", + "mediumMountain": null, + "mountain": 73, + "overall": null, + "plain": 65, + "prologue": 61, + "recuperation": 68, + "resistance": 64, + "sprint": 59, + "timeTrial": 63, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 76, + "age": null, + "baroudeur": 69, + "cobble": 63, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 70, + "endurance": 69, + "firstName": "Eduard", + "hill": 76, + "id": 3169, + "lastName": "Prades", + "mediumMountain": null, + "mountain": 72, + "overall": null, + "plain": 71, + "prologue": 65, + "recuperation": 67, + "resistance": 69, + "sprint": 68, + "timeTrial": 64, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 75, + "age": null, + "baroudeur": 68, + "cobble": 69, + "contractEndYear": 2019, + "country": "COL", + "downhilling": 76, + "endurance": 70, + "firstName": "Nairo", + "hill": 77, + "id": 2046, + "lastName": "Quintana", + "mediumMountain": null, + "mountain": 81, + "overall": null, + "plain": 68, + "prologue": 73, + "recuperation": 79, + "resistance": 75, + "sprint": 63, + "timeTrial": 71, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 75, + "age": null, + "baroudeur": 71, + "cobble": 78, + "contractEndYear": 2019, + "country": "BEL", + "downhilling": 70, + "endurance": 72, + "firstName": "Jürgen", + "hill": 73, + "id": 711, + "lastName": "Roelandts", + "mediumMountain": null, + "mountain": 63, + "overall": null, + "plain": 76, + "prologue": 74, + "recuperation": 68, + "resistance": 73, + "sprint": 73, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 76, + "age": null, + "baroudeur": 59, + "cobble": 68, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 74, + "endurance": 69, + "firstName": "José Joaquin", + "hill": 73, + "id": 697, + "lastName": "Rojas", + "mediumMountain": null, + "mountain": 67, + "overall": null, + "plain": 73, + "prologue": 64, + "recuperation": 69, + "resistance": 69, + "sprint": 74, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 69, + "cobble": 60, + "contractEndYear": 2019, + "country": "ARG", + "downhilling": 65, + "endurance": 64, + "firstName": "Eduardo", + "hill": 73, + "id": 3056, + "lastName": "Sepulveda", + "mediumMountain": null, + "mountain": 73, + "overall": null, + "plain": 67, + "prologue": 67, + "recuperation": 68, + "resistance": 66, + "sprint": 65, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 66, + "age": null, + "baroudeur": 73, + "cobble": 65, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 70, + "endurance": 70, + "firstName": "Marc", + "hill": 77, + "id": 3700, + "lastName": "Soler", + "mediumMountain": null, + "mountain": 79, + "overall": null, + "plain": 70, + "prologue": 73, + "recuperation": 72, + "resistance": 72, + "sprint": 60, + "timeTrial": 73, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 64, + "age": null, + "baroudeur": 71, + "cobble": 73, + "contractEndYear": 2019, + "country": "GER", + "downhilling": 71, + "endurance": 68, + "firstName": "Jasha", + "hill": 69, + "id": 2510, + "lastName": "Sütterlin", + "mediumMountain": null, + "mountain": 59, + "overall": null, + "plain": 74, + "prologue": 75, + "recuperation": 67, + "resistance": 66, + "sprint": 65, + "timeTrial": 76, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 67, + "cobble": 57, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 72, + "endurance": 63, + "firstName": "Rafael", + "hill": 73, + "id": 1919, + "lastName": "Valls", + "mediumMountain": null, + "mountain": 70, + "overall": null, + "plain": 66, + "prologue": 65, + "recuperation": 67, + "resistance": 65, + "sprint": 64, + "timeTrial": 62, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 78, + "age": null, + "baroudeur": 70, + "cobble": 72, + "contractEndYear": 2019, + "country": "ESP", + "downhilling": 75, + "endurance": 80, + "firstName": "Alejandro", + "hill": 80, + "id": 3, + "lastName": "Valverde", + "mediumMountain": null, + "mountain": 79, + "overall": null, + "plain": 72, + "prologue": 78, + "recuperation": 78, + "resistance": 79, + "sprint": 72, + "timeTrial": 72, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 73, + "cobble": 58, + "contractEndYear": 2020, + "country": "ESP", + "downhilling": 68, + "endurance": 69, + "firstName": "Carlos", + "hill": 73, + "id": 2853, + "lastName": "Verona", + "mediumMountain": null, + "mountain": 74, + "overall": null, + "plain": 66, + "prologue": 68, + "recuperation": 69, + "resistance": 70, + "sprint": 55, + "timeTrial": 63, + "type": null, + "value": 0, + "wage": 0, + }, + ], + "teamId": 1, +} +`; + +exports[`getTeamRoster > returns the roster for a given team for Pro cycling manager 2021 1`] = ` +{ + "cyclists": [ + { + "acceleration": 58, + "age": null, + "baroudeur": 60, + "cobble": 58, + "contractEndYear": 2021, + "country": "COL", + "downhilling": 62, + "endurance": 60, + "firstName": "Juan Diego", + "hill": 65, + "id": 7053, + "lastName": "Alba", + "mediumMountain": null, + "mountain": 67, + "overall": null, + "plain": 61, + "prologue": 59, + "recuperation": 62, + "resistance": 60, + "sprint": 56, + "timeTrial": 59, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 67, + "age": null, + "baroudeur": 64, + "cobble": 67, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 65, + "endurance": 66, + "firstName": "Jorge", + "hill": 71, + "id": 5630, + "lastName": "Arcas", + "mediumMountain": null, + "mountain": 65, + "overall": null, + "plain": 73, + "prologue": 71, + "recuperation": 67, + "resistance": 65, + "sprint": 64, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 72, + "cobble": 60, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 72, + "endurance": 64, + "firstName": "Héctor", + "hill": 72, + "id": 5956, + "lastName": "Carretero", + "mediumMountain": null, + "mountain": 69, + "overall": null, + "plain": 72, + "prologue": 66, + "recuperation": 66, + "resistance": 64, + "sprint": 60, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 63, + "age": null, + "baroudeur": 66, + "cobble": 60, + "contractEndYear": 2021, + "country": "ITA", + "downhilling": 65, + "endurance": 68, + "firstName": "Dario", + "hill": 74, + "id": 983, + "lastName": "Cataldo", + "mediumMountain": null, + "mountain": 73, + "overall": null, + "plain": 67, + "prologue": 71, + "recuperation": 72, + "resistance": 68, + "sprint": 60, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 71, + "cobble": 65, + "contractEndYear": 2021, + "country": "GBR", + "downhilling": 69, + "endurance": 65, + "firstName": "Gabriel", + "hill": 65, + "id": 6296, + "lastName": "Cullaigh", + "mediumMountain": null, + "mountain": 55, + "overall": null, + "plain": 69, + "prologue": 63, + "recuperation": 62, + "resistance": 63, + "sprint": 74, + "timeTrial": 62, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 61, + "age": null, + "baroudeur": 69, + "cobble": 64, + "contractEndYear": 2022, + "country": "ESP", + "downhilling": 65, + "endurance": 62, + "firstName": "Inigo", + "hill": 69, + "id": 7060, + "lastName": "Elosegui", + "mediumMountain": null, + "mountain": 68, + "overall": null, + "plain": 67, + "prologue": 64, + "recuperation": 65, + "resistance": 62, + "sprint": 58, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 64, + "age": null, + "baroudeur": 81, + "cobble": 72, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 72, + "endurance": 68, + "firstName": "Imanol", + "hill": 68, + "id": 783, + "lastName": "Erviti", + "mediumMountain": null, + "mountain": 64, + "overall": null, + "plain": 75, + "prologue": 68, + "recuperation": 69, + "resistance": 65, + "sprint": 61, + "timeTrial": 67, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 75, + "age": null, + "baroudeur": 71, + "cobble": 75, + "contractEndYear": 2023, + "country": "ESP", + "downhilling": 70, + "endurance": 73, + "firstName": "Iván", + "hill": 72, + "id": 5106, + "lastName": "García Cortina", + "mediumMountain": null, + "mountain": 62, + "overall": null, + "plain": 76, + "prologue": 70, + "recuperation": 69, + "resistance": 72, + "sprint": 76, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 61, + "age": null, + "baroudeur": 68, + "cobble": 56, + "contractEndYear": 2023, + "country": "PRI", + "downhilling": 64, + "endurance": 61, + "firstName": "Abner", + "hill": 69, + "id": 7391, + "lastName": "González", + "mediumMountain": null, + "mountain": 69, + "overall": null, + "plain": 64, + "prologue": 62, + "recuperation": 65, + "resistance": 62, + "sprint": 59, + "timeTrial": 60, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 58, + "age": null, + "baroudeur": 60, + "cobble": 66, + "contractEndYear": 2021, + "country": "GER", + "downhilling": 66, + "endurance": 64, + "firstName": "Juri", + "hill": 65, + "id": 6640, + "lastName": "Hollmann", + "mediumMountain": null, + "mountain": 58, + "overall": null, + "plain": 70, + "prologue": 69, + "recuperation": 65, + "resistance": 64, + "sprint": 61, + "timeTrial": 70, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 64, + "age": null, + "baroudeur": 70, + "cobble": 73, + "contractEndYear": 2023, + "country": "SWI", + "downhilling": 73, + "endurance": 67, + "firstName": "Johan", + "hill": 69, + "id": 7073, + "lastName": "Jacobs", + "mediumMountain": null, + "mountain": 60, + "overall": null, + "plain": 73, + "prologue": 68, + "recuperation": 64, + "resistance": 66, + "sprint": 61, + "timeTrial": 67, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 65, + "cobble": 67, + "contractEndYear": 2023, + "country": "USA", + "downhilling": 70, + "endurance": 67, + "firstName": "Matteo", + "hill": 74, + "id": 7032, + "lastName": "Jorgenson", + "mediumMountain": null, + "mountain": 72, + "overall": null, + "plain": 72, + "prologue": 69, + "recuperation": 70, + "resistance": 67, + "sprint": 65, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 67, + "cobble": 60, + "contractEndYear": 2021, + "country": "COL", + "downhilling": 64, + "endurance": 71, + "firstName": "Miguel Angel", + "hill": 78, + "id": 3705, + "lastName": "López", + "mediumMountain": null, + "mountain": 80, + "overall": null, + "plain": 69, + "prologue": 73, + "recuperation": 78, + "resistance": 74, + "sprint": 61, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 71, + "age": null, + "baroudeur": 71, + "cobble": 59, + "contractEndYear": 2022, + "country": "ESP", + "downhilling": 69, + "endurance": 70, + "firstName": "Enric", + "hill": 77, + "id": 5955, + "lastName": "Mas", + "mediumMountain": null, + "mountain": 80, + "overall": null, + "plain": 69, + "prologue": 68, + "recuperation": 78, + "resistance": 73, + "sprint": 62, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 80, + "cobble": 61, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 71, + "endurance": 65, + "firstName": "Lluís", + "hill": 70, + "id": 2006, + "lastName": "Mas Bonet", + "mediumMountain": null, + "mountain": 66, + "overall": null, + "plain": 73, + "prologue": 68, + "recuperation": 69, + "resistance": 66, + "sprint": 63, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 62, + "cobble": 65, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 68, + "endurance": 62, + "firstName": "Sebastián", + "hill": 64, + "id": 5852, + "lastName": "Mora", + "mediumMountain": null, + "mountain": 57, + "overall": null, + "plain": 71, + "prologue": 67, + "recuperation": 62, + "resistance": 65, + "sprint": 63, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 72, + "cobble": 65, + "contractEndYear": 2023, + "country": "AUT", + "downhilling": 79, + "endurance": 67, + "firstName": "Gregor", + "hill": 76, + "id": 3197, + "lastName": "Mühlberger", + "mediumMountain": null, + "mountain": 73, + "overall": null, + "plain": 69, + "prologue": 68, + "recuperation": 67, + "resistance": 67, + "sprint": 66, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 60, + "age": null, + "baroudeur": 65, + "cobble": 62, + "contractEndYear": 2021, + "country": "DEN", + "downhilling": 63, + "endurance": 62, + "firstName": "Mathias", + "hill": 66, + "id": 6584, + "lastName": "Norsgaard", + "mediumMountain": null, + "mountain": 58, + "overall": null, + "plain": 70, + "prologue": 68, + "recuperation": 60, + "resistance": 63, + "sprint": 61, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 70, + "cobble": 72, + "contractEndYear": 2021, + "country": "POR", + "downhilling": 67, + "endurance": 66, + "firstName": "Nelson", + "hill": 73, + "id": 1975, + "lastName": "Oliveira", + "mediumMountain": null, + "mountain": 70, + "overall": null, + "plain": 75, + "prologue": 76, + "recuperation": 68, + "resistance": 69, + "sprint": 58, + "timeTrial": 78, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 66, + "age": null, + "baroudeur": 63, + "cobble": 57, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 70, + "endurance": 67, + "firstName": "Antonio", + "hill": 73, + "id": 5631, + "lastName": "Pedrero", + "mediumMountain": null, + "mountain": 76, + "overall": null, + "plain": 67, + "prologue": 63, + "recuperation": 69, + "resistance": 67, + "sprint": 59, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 59, + "cobble": 68, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 74, + "endurance": 69, + "firstName": "José Joaquin", + "hill": 73, + "id": 697, + "lastName": "Rojas", + "mediumMountain": null, + "mountain": 69, + "overall": null, + "plain": 73, + "prologue": 64, + "recuperation": 70, + "resistance": 69, + "sprint": 69, + "timeTrial": 64, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 63, + "age": null, + "baroudeur": 67, + "cobble": 59, + "contractEndYear": 2021, + "country": "COL", + "downhilling": 65, + "endurance": 64, + "firstName": "Einer", + "hill": 73, + "id": 7064, + "lastName": "Rubio", + "mediumMountain": null, + "mountain": 75, + "overall": null, + "plain": 64, + "prologue": 58, + "recuperation": 68, + "resistance": 66, + "sprint": 58, + "timeTrial": 58, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 63, + "age": null, + "baroudeur": 67, + "cobble": 62, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 69, + "endurance": 66, + "firstName": "Sergio", + "hill": 71, + "id": 6417, + "lastName": "Samitier", + "mediumMountain": null, + "mountain": 74, + "overall": null, + "plain": 69, + "prologue": 67, + "recuperation": 71, + "resistance": 66, + "sprint": 61, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 76, + "age": null, + "baroudeur": 75, + "cobble": 71, + "contractEndYear": 2022, + "country": "ESP", + "downhilling": 68, + "endurance": 67, + "firstName": "Gonzalo", + "hill": 74, + "id": 6407, + "lastName": "Serrano", + "mediumMountain": null, + "mountain": 66, + "overall": null, + "plain": 72, + "prologue": 65, + "recuperation": 68, + "resistance": 67, + "sprint": 68, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 66, + "age": null, + "baroudeur": 74, + "cobble": 65, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 70, + "endurance": 70, + "firstName": "Marc", + "hill": 76, + "id": 3700, + "lastName": "Soler", + "mediumMountain": null, + "mountain": 77, + "overall": null, + "plain": 74, + "prologue": 73, + "recuperation": 72, + "resistance": 71, + "sprint": 60, + "timeTrial": 73, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 61, + "cobble": 64, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 69, + "endurance": 65, + "firstName": "Albert", + "hill": 66, + "id": 5844, + "lastName": "Torres", + "mediumMountain": null, + "mountain": 57, + "overall": null, + "plain": 72, + "prologue": 68, + "recuperation": 68, + "resistance": 66, + "sprint": 71, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 70, + "cobble": 70, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 75, + "endurance": 74, + "firstName": "Alejandro", + "hill": 80, + "id": 3, + "lastName": "Valverde", + "mediumMountain": null, + "mountain": 76, + "overall": null, + "plain": 70, + "prologue": 73, + "recuperation": 73, + "resistance": 74, + "sprint": 67, + "timeTrial": 72, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 73, + "cobble": 58, + "contractEndYear": 2021, + "country": "ESP", + "downhilling": 68, + "endurance": 68, + "firstName": "Carlos", + "hill": 72, + "id": 2853, + "lastName": "Verona", + "mediumMountain": null, + "mountain": 73, + "overall": null, + "plain": 66, + "prologue": 68, + "recuperation": 69, + "resistance": 69, + "sprint": 55, + "timeTrial": 63, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 73, + "cobble": 59, + "contractEndYear": 2021, + "country": "ITA", + "downhilling": 68, + "endurance": 66, + "firstName": "Davide", + "hill": 76, + "id": 3361, + "lastName": "Villella", + "mediumMountain": null, + "mountain": 72, + "overall": null, + "plain": 68, + "prologue": 60, + "recuperation": 69, + "resistance": 65, + "sprint": 65, + "timeTrial": 58, + "type": null, + "value": 0, + "wage": 0, + }, + ], + "teamId": 1, +} +`; + +exports[`getTeamRoster > returns the roster for a given team for Pro cycling manager 2025 1`] = ` +{ + "cyclists": [ + { + "acceleration": 62, + "age": null, + "baroudeur": 64, + "cobble": 67, + "contractEndYear": 2025, + "country": "ESP", + "downhilling": 65, + "endurance": 66, + "firstName": "Jorge", + "hill": 70, + "id": 5630, + "lastName": "Arcas", + "mediumMountain": 68, + "mountain": 64, + "overall": 0, + "plain": 71, + "prologue": 71, + "recuperation": 67, + "resistance": 65, + "sprint": 60, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 75, + "age": null, + "baroudeur": 62, + "cobble": 66, + "contractEndYear": 2026, + "country": "VEN", + "downhilling": 71, + "endurance": 70, + "firstName": "Orluis", + "hill": 76, + "id": 7113, + "lastName": "Aular", + "mediumMountain": 72, + "mountain": 69, + "overall": 0, + "plain": 70, + "prologue": 69, + "recuperation": 71, + "resistance": 73, + "sprint": 74, + "timeTrial": 67, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 71, + "age": null, + "baroudeur": 74, + "cobble": 65, + "contractEndYear": 2027, + "country": "ESP", + "downhilling": 70, + "endurance": 71, + "firstName": "Jon", + "hill": 74, + "id": 7442, + "lastName": "Barrenetxea", + "mediumMountain": 69, + "mountain": 63, + "overall": 0, + "plain": 72, + "prologue": 64, + "recuperation": 68, + "resistance": 71, + "sprint": 70, + "timeTrial": 64, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 67, + "age": null, + "baroudeur": 72, + "cobble": 65, + "contractEndYear": 2025, + "country": "USA", + "downhilling": 68, + "endurance": 69, + "firstName": "William", + "hill": 73, + "id": 3932, + "lastName": "Barta", + "mediumMountain": 73, + "mountain": 71, + "overall": 0, + "plain": 74, + "prologue": 71, + "recuperation": 74, + "resistance": 66, + "sprint": 61, + "timeTrial": 73, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 73, + "age": null, + "baroudeur": 71, + "cobble": 70, + "contractEndYear": 2027, + "country": "ESP", + "downhilling": 76, + "endurance": 70, + "firstName": "Carlos", + "hill": 76, + "id": 7161, + "lastName": "Canal", + "mediumMountain": 73, + "mountain": 66, + "overall": 0, + "plain": 73, + "prologue": 70, + "recuperation": 67, + "resistance": 73, + "sprint": 71, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 68, + "age": null, + "baroudeur": 74, + "cobble": 69, + "contractEndYear": 2027, + "country": "ESP", + "downhilling": 72, + "endurance": 73, + "firstName": "Pablo", + "hill": 76, + "id": 8291, + "lastName": "Castrillo", + "mediumMountain": 76, + "mountain": 75, + "overall": 0, + "plain": 73, + "prologue": 70, + "recuperation": 72, + "resistance": 70, + "sprint": 60, + "timeTrial": 71, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 68, + "age": null, + "baroudeur": 72, + "cobble": 60, + "contractEndYear": 2026, + "country": "ECU", + "downhilling": 70, + "endurance": 71, + "firstName": "Jefferson Alveiro", + "hill": 75, + "id": 7118, + "lastName": "Cepeda", + "mediumMountain": 76, + "mountain": 75, + "overall": 0, + "plain": 67, + "prologue": 68, + "recuperation": 71, + "resistance": 69, + "sprint": 62, + "timeTrial": 67, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 74, + "age": null, + "baroudeur": 66, + "cobble": 67, + "contractEndYear": 2025, + "country": "ITA", + "downhilling": 71, + "endurance": 68, + "firstName": "Davide", + "hill": 69, + "id": 1945, + "lastName": "Cimolai", + "mediumMountain": 63, + "mountain": 59, + "overall": 0, + "plain": 72, + "prologue": 65, + "recuperation": 71, + "resistance": 68, + "sprint": 73, + "timeTrial": 63, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 72, + "cobble": 67, + "contractEndYear": 2026, + "country": "ITA", + "downhilling": 74, + "endurance": 71, + "firstName": "Davide", + "hill": 75, + "id": 3363, + "lastName": "Formolo", + "mediumMountain": 74, + "mountain": 72, + "overall": 0, + "plain": 70, + "prologue": 67, + "recuperation": 74, + "resistance": 72, + "sprint": 61, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 71, + "cobble": 75, + "contractEndYear": 2026, + "country": "ESP", + "downhilling": 70, + "endurance": 71, + "firstName": "Iván", + "hill": 71, + "id": 5106, + "lastName": "García Cortina", + "mediumMountain": 66, + "mountain": 61, + "overall": 0, + "plain": 74, + "prologue": 70, + "recuperation": 72, + "resistance": 70, + "sprint": 73, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 75, + "age": null, + "baroudeur": 64, + "cobble": 70, + "contractEndYear": 2025, + "country": "COL", + "downhilling": 78, + "endurance": 70, + "firstName": "Fernando", + "hill": 67, + "id": 5637, + "lastName": "Gaviria", + "mediumMountain": 64, + "mountain": 59, + "overall": 0, + "plain": 71, + "prologue": 68, + "recuperation": 70, + "resistance": 72, + "sprint": 77, + "timeTrial": 56, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 75, + "cobble": 63, + "contractEndYear": 2025, + "country": "POR", + "downhilling": 68, + "endurance": 70, + "firstName": "Ruben", + "hill": 75, + "id": 3925, + "lastName": "Guerreiro", + "mediumMountain": 75, + "mountain": 73, + "overall": 0, + "plain": 68, + "prologue": 66, + "recuperation": 70, + "resistance": 71, + "sprint": 68, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 60, + "age": null, + "baroudeur": 64, + "cobble": 62, + "contractEndYear": 2026, + "country": "GER", + "downhilling": 66, + "endurance": 65, + "firstName": "Michel", + "hill": 70, + "id": 8927, + "lastName": "Hessmann", + "mediumMountain": 70, + "mountain": 66, + "overall": 0, + "plain": 70, + "prologue": 65, + "recuperation": 64, + "resistance": 63, + "sprint": 58, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 74, + "cobble": 64, + "contractEndYear": 2025, + "country": "ESP", + "downhilling": 69, + "endurance": 76, + "firstName": "Enric", + "hill": 77, + "id": 5955, + "lastName": "Mas", + "mediumMountain": 78, + "mountain": 78, + "overall": 0, + "plain": 67, + "prologue": 68, + "recuperation": 76, + "resistance": 72, + "sprint": 62, + "timeTrial": 69, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 68, + "age": null, + "baroudeur": 59, + "cobble": 66, + "contractEndYear": 2026, + "country": "ITA", + "downhilling": 68, + "endurance": 65, + "firstName": "Lorenzo", + "hill": 70, + "id": 7693, + "lastName": "Milesi", + "mediumMountain": 68, + "mountain": 65, + "overall": 0, + "plain": 72, + "prologue": 72, + "recuperation": 66, + "resistance": 66, + "sprint": 60, + "timeTrial": 74, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 62, + "age": null, + "baroudeur": 68, + "cobble": 65, + "contractEndYear": 2026, + "country": "ITA", + "downhilling": 66, + "endurance": 60, + "firstName": "Manlio", + "hill": 62, + "id": 8318, + "lastName": "Moro", + "mediumMountain": 58, + "mountain": 55, + "overall": 0, + "plain": 66, + "prologue": 68, + "recuperation": 60, + "resistance": 61, + "sprint": 60, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 73, + "cobble": 65, + "contractEndYear": 2025, + "country": "AUT", + "downhilling": 74, + "endurance": 67, + "firstName": "Gregor", + "hill": 75, + "id": 3197, + "lastName": "Mühlberger", + "mediumMountain": 74, + "mountain": 71, + "overall": 0, + "plain": 68, + "prologue": 68, + "recuperation": 67, + "resistance": 69, + "sprint": 66, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 60, + "age": null, + "baroudeur": 70, + "cobble": 72, + "contractEndYear": 2026, + "country": "DEN", + "downhilling": 77, + "endurance": 66, + "firstName": "Mathias", + "hill": 68, + "id": 6584, + "lastName": "Norsgaard", + "mediumMountain": 65, + "mountain": 61, + "overall": 0, + "plain": 72, + "prologue": 73, + "recuperation": 64, + "resistance": 68, + "sprint": 61, + "timeTrial": 71, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 65, + "age": null, + "baroudeur": 70, + "cobble": 72, + "contractEndYear": 2025, + "country": "POR", + "downhilling": 67, + "endurance": 70, + "firstName": "Nelson", + "hill": 73, + "id": 1975, + "lastName": "Oliveira", + "mediumMountain": 72, + "mountain": 70, + "overall": 0, + "plain": 74, + "prologue": 75, + "recuperation": 68, + "resistance": 69, + "sprint": 58, + "timeTrial": 76, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 64, + "age": null, + "baroudeur": 63, + "cobble": 57, + "contractEndYear": 2025, + "country": "ESP", + "downhilling": 70, + "endurance": 67, + "firstName": "Antonio", + "hill": 71, + "id": 5631, + "lastName": "Pedrero", + "mediumMountain": 73, + "mountain": 73, + "overall": 0, + "plain": 65, + "prologue": 63, + "recuperation": 68, + "resistance": 65, + "sprint": 59, + "timeTrial": 64, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 54, + "age": null, + "baroudeur": 59, + "cobble": 52, + "contractEndYear": 2027, + "country": "COL", + "downhilling": 68, + "endurance": 62, + "firstName": "Diego", + "hill": 66, + "id": 8678, + "lastName": "Pescador", + "mediumMountain": 68, + "mountain": 69, + "overall": 0, + "plain": 64, + "prologue": 57, + "recuperation": 56, + "resistance": 59, + "sprint": 53, + "timeTrial": 56, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 68, + "age": null, + "baroudeur": 68, + "cobble": 67, + "contractEndYear": 2025, + "country": "COL", + "downhilling": 80, + "endurance": 68, + "firstName": "Nairo", + "hill": 73, + "id": 2046, + "lastName": "Quintana", + "mediumMountain": 73, + "mountain": 74, + "overall": 0, + "plain": 67, + "prologue": 64, + "recuperation": 71, + "resistance": 68, + "sprint": 60, + "timeTrial": 64, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 63, + "age": null, + "baroudeur": 74, + "cobble": 65, + "contractEndYear": 2027, + "country": "ESP", + "downhilling": 72, + "endurance": 73, + "firstName": "Iván", + "hill": 75, + "id": 7767, + "lastName": "Romeo", + "mediumMountain": 74, + "mountain": 70, + "overall": 0, + "plain": 76, + "prologue": 76, + "recuperation": 71, + "resistance": 71, + "sprint": 61, + "timeTrial": 75, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 66, + "age": null, + "baroudeur": 70, + "cobble": 65, + "contractEndYear": 2027, + "country": "ESP", + "downhilling": 68, + "endurance": 71, + "firstName": "Javier", + "hill": 77, + "id": 7397, + "lastName": "Romo", + "mediumMountain": 72, + "mountain": 70, + "overall": 0, + "plain": 73, + "prologue": 67, + "recuperation": 68, + "resistance": 70, + "sprint": 58, + "timeTrial": 68, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 73, + "cobble": 59, + "contractEndYear": 2026, + "country": "COL", + "downhilling": 73, + "endurance": 74, + "firstName": "Einer", + "hill": 75, + "id": 7064, + "lastName": "Rubio", + "mediumMountain": 77, + "mountain": 78, + "overall": 0, + "plain": 66, + "prologue": 64, + "recuperation": 75, + "resistance": 71, + "sprint": 60, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 72, + "age": null, + "baroudeur": 75, + "cobble": 71, + "contractEndYear": 2026, + "country": "ESP", + "downhilling": 70, + "endurance": 68, + "firstName": "Gonzalo", + "hill": 72, + "id": 6407, + "lastName": "Serrano", + "mediumMountain": 69, + "mountain": 68, + "overall": 0, + "plain": 71, + "prologue": 65, + "recuperation": 68, + "resistance": 71, + "sprint": 68, + "timeTrial": 65, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 71, + "age": null, + "baroudeur": 61, + "cobble": 61, + "contractEndYear": 2027, + "country": "ESP", + "downhilling": 70, + "endurance": 71, + "firstName": "Pelayo", + "hill": 75, + "id": 7420, + "lastName": "Sánchez", + "mediumMountain": 75, + "mountain": 72, + "overall": 0, + "plain": 69, + "prologue": 67, + "recuperation": 73, + "resistance": 73, + "sprint": 69, + "timeTrial": 66, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 70, + "age": null, + "baroudeur": 71, + "cobble": 60, + "contractEndYear": 2026, + "country": "ERI", + "downhilling": 67, + "endurance": 68, + "firstName": "Natnael", + "hill": 75, + "id": 7372, + "lastName": "Tesfatsion", + "mediumMountain": 74, + "mountain": 73, + "overall": 0, + "plain": 67, + "prologue": 59, + "recuperation": 67, + "resistance": 70, + "sprint": 69, + "timeTrial": 59, + "type": null, + "value": 0, + "wage": 0, + }, + { + "acceleration": 69, + "age": null, + "baroudeur": 61, + "cobble": 64, + "contractEndYear": null, + "country": "ESP", + "downhilling": 69, + "endurance": 65, + "firstName": "Albert", + "hill": 66, + "id": 5844, + "lastName": "Torres", + "mediumMountain": 62, + "mountain": 57, + "overall": 0, + "plain": 70, + "prologue": 68, + "recuperation": 68, + "resistance": 66, + "sprint": 69, + "timeTrial": 61, + "type": null, + "value": 0, + "wage": null, + }, + ], + "teamId": 1, +} +`; diff --git a/test/tools/__snapshots__/search-cyclist.test.ts.snap b/test/tools/__snapshots__/search-cyclist.test.ts.snap new file mode 100644 index 0000000..ca4aa86 --- /dev/null +++ b/test/tools/__snapshots__/search-cyclist.test.ts.snap @@ -0,0 +1,869 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`searchCyclist > finds cyclists by last name for Pro cycling manager 2018 1`] = ` +{ + "cyclists": [ + { + "acceleration": 74, + "baroudeur": 65, + "cobble": 67, + "country": "BEL", + "currentAbility": null, + "downhilling": 75, + "endurance": 68, + "firstName": "Tosh", + "hill": 74, + "id": 2548, + "lastName": "Van der Sande", + "mediumMountain": null, + "mountain": 62, + "plain": 72, + "prologue": 65, + "recuperation": 68, + "resistance": 67, + "sprint": 72, + "timeTrial": 65, + }, + { + "acceleration": 73, + "baroudeur": 61, + "cobble": 65, + "country": "NED", + "currentAbility": null, + "downhilling": 67, + "endurance": 67, + "firstName": "Nick", + "hill": 72, + "id": 3396, + "lastName": "Van Der Lijke", + "mediumMountain": null, + "mountain": 64, + "plain": 70, + "prologue": 67, + "recuperation": 67, + "resistance": 65, + "sprint": 68, + "timeTrial": 63, + }, + { + "acceleration": 65, + "baroudeur": 66, + "cobble": 61, + "country": "NED", + "currentAbility": null, + "downhilling": 66, + "endurance": 60, + "firstName": "Patrick", + "hill": 58, + "id": 3869, + "lastName": "Van Der Duin", + "mediumMountain": null, + "mountain": 54, + "plain": 67, + "prologue": 63, + "recuperation": 61, + "resistance": 59, + "sprint": 64, + "timeTrial": 60, + }, + { + "acceleration": 67, + "baroudeur": 67, + "cobble": 62, + "country": "NED", + "currentAbility": null, + "downhilling": 67, + "endurance": 62, + "firstName": "Taco", + "hill": 61, + "id": 3871, + "lastName": "Van Der Hoorn", + "mediumMountain": null, + "mountain": 55, + "plain": 68, + "prologue": 64, + "recuperation": 65, + "resistance": 63, + "sprint": 65, + "timeTrial": 62, + }, + { + "acceleration": 72, + "baroudeur": 61, + "cobble": 63, + "country": "AUS", + "currentAbility": null, + "downhilling": 69, + "endurance": 65, + "firstName": "Neil", + "hill": 64, + "id": 3955, + "lastName": "Van Der Ploeg", + "mediumMountain": null, + "mountain": 56, + "plain": 70, + "prologue": 69, + "recuperation": 66, + "resistance": 63, + "sprint": 70, + "timeTrial": 62, + }, + { + "acceleration": 72, + "baroudeur": 69, + "cobble": 63, + "country": "NED", + "currentAbility": null, + "downhilling": 63, + "endurance": 61, + "firstName": "Nick", + "hill": 59, + "id": 3968, + "lastName": "Van Der Meer", + "mediumMountain": null, + "mountain": 54, + "plain": 69, + "prologue": 63, + "recuperation": 61, + "resistance": 60, + "sprint": 71, + "timeTrial": 60, + }, + { + "acceleration": 65, + "baroudeur": 68, + "cobble": 61, + "country": "NED", + "currentAbility": null, + "downhilling": 65, + "endurance": 61, + "firstName": "Arno", + "hill": 60, + "id": 3995, + "lastName": "Van Der Zwet", + "mediumMountain": null, + "mountain": 55, + "plain": 69, + "prologue": 67, + "recuperation": 64, + "resistance": 63, + "sprint": 64, + "timeTrial": 66, + }, + { + "acceleration": 61, + "baroudeur": 68, + "cobble": 56, + "country": "NED", + "currentAbility": null, + "downhilling": 61, + "endurance": 58, + "firstName": "Mel", + "hill": 62, + "id": 6025, + "lastName": "Van Der Veekens", + "mediumMountain": null, + "mountain": 59, + "plain": 64, + "prologue": 61, + "recuperation": 52, + "resistance": 56, + "sprint": 57, + "timeTrial": 58, + }, + { + "acceleration": 64, + "baroudeur": 71, + "cobble": 51, + "country": "NED", + "currentAbility": null, + "downhilling": 68, + "endurance": 56, + "firstName": "Bas", + "hill": 60, + "id": 6072, + "lastName": "Van Der Kooij", + "mediumMountain": null, + "mountain": 61, + "plain": 63, + "prologue": 59, + "recuperation": 56, + "resistance": 57, + "sprint": 57, + "timeTrial": 56, + }, + { + "acceleration": 52, + "baroudeur": 56, + "cobble": 57, + "country": "NED", + "currentAbility": null, + "downhilling": 65, + "endurance": 57, + "firstName": "Dennis", + "hill": 56, + "id": 6085, + "lastName": "van der Horst", + "mediumMountain": null, + "mountain": 56, + "plain": 59, + "prologue": 59, + "recuperation": 52, + "resistance": 57, + "sprint": 59, + "timeTrial": 59, + }, + ], +} +`; + +exports[`searchCyclist > finds cyclists by last name for Pro cycling manager 2019 1`] = ` +{ + "cyclists": [ + { + "acceleration": 74, + "baroudeur": 65, + "cobble": 68, + "country": "BEL", + "currentAbility": null, + "downhilling": 75, + "endurance": 68, + "firstName": "Tosh", + "hill": 73, + "id": 2548, + "lastName": "Van der Sande", + "mediumMountain": null, + "mountain": 62, + "plain": 72, + "prologue": 65, + "recuperation": 68, + "resistance": 67, + "sprint": 72, + "timeTrial": 65, + }, + { + "acceleration": 74, + "baroudeur": 61, + "cobble": 65, + "country": "NED", + "currentAbility": null, + "downhilling": 67, + "endurance": 69, + "firstName": "Nick", + "hill": 72, + "id": 3396, + "lastName": "Van Der Lijke", + "mediumMountain": null, + "mountain": 64, + "plain": 71, + "prologue": 67, + "recuperation": 67, + "resistance": 69, + "sprint": 70, + "timeTrial": 63, + }, + { + "acceleration": 65, + "baroudeur": 66, + "cobble": 61, + "country": "NED", + "currentAbility": null, + "downhilling": 66, + "endurance": 60, + "firstName": "Patrick", + "hill": 58, + "id": 3869, + "lastName": "Van Der Duin", + "mediumMountain": null, + "mountain": 54, + "plain": 67, + "prologue": 63, + "recuperation": 61, + "resistance": 59, + "sprint": 64, + "timeTrial": 60, + }, + { + "acceleration": 67, + "baroudeur": 71, + "cobble": 68, + "country": "NED", + "currentAbility": null, + "downhilling": 67, + "endurance": 68, + "firstName": "Taco", + "hill": 67, + "id": 3871, + "lastName": "Van Der Hoorn", + "mediumMountain": null, + "mountain": 59, + "plain": 74, + "prologue": 64, + "recuperation": 68, + "resistance": 69, + "sprint": 65, + "timeTrial": 62, + }, + { + "acceleration": 72, + "baroudeur": 61, + "cobble": 63, + "country": "AUS", + "currentAbility": null, + "downhilling": 69, + "endurance": 65, + "firstName": "Neil", + "hill": 64, + "id": 3955, + "lastName": "Van Der Ploeg", + "mediumMountain": null, + "mountain": 56, + "plain": 70, + "prologue": 69, + "recuperation": 66, + "resistance": 63, + "sprint": 70, + "timeTrial": 62, + }, + { + "acceleration": 72, + "baroudeur": 69, + "cobble": 63, + "country": "NED", + "currentAbility": null, + "downhilling": 63, + "endurance": 61, + "firstName": "Nick", + "hill": 59, + "id": 3968, + "lastName": "Van Der Meer", + "mediumMountain": null, + "mountain": 54, + "plain": 69, + "prologue": 63, + "recuperation": 61, + "resistance": 60, + "sprint": 71, + "timeTrial": 60, + }, + { + "acceleration": 65, + "baroudeur": 68, + "cobble": 61, + "country": "NED", + "currentAbility": null, + "downhilling": 65, + "endurance": 61, + "firstName": "Arno", + "hill": 60, + "id": 3995, + "lastName": "Van Der Zwet", + "mediumMountain": null, + "mountain": 55, + "plain": 69, + "prologue": 67, + "recuperation": 64, + "resistance": 63, + "sprint": 64, + "timeTrial": 66, + }, + { + "acceleration": 72, + "baroudeur": 61, + "cobble": 64, + "country": "NED", + "currentAbility": null, + "downhilling": 75, + "endurance": 57, + "firstName": "Maik", + "hill": 60, + "id": 5920, + "lastName": "Van Der Heijden", + "mediumMountain": null, + "mountain": 54, + "plain": 65, + "prologue": 66, + "recuperation": 58, + "resistance": 59, + "sprint": 69, + "timeTrial": 64, + }, + { + "acceleration": 61, + "baroudeur": 68, + "cobble": 56, + "country": "NED", + "currentAbility": null, + "downhilling": 61, + "endurance": 58, + "firstName": "Mel", + "hill": 62, + "id": 6025, + "lastName": "Van Der Veekens", + "mediumMountain": null, + "mountain": 59, + "plain": 64, + "prologue": 61, + "recuperation": 52, + "resistance": 56, + "sprint": 57, + "timeTrial": 58, + }, + { + "acceleration": 76, + "baroudeur": 67, + "cobble": 65, + "country": "NED", + "currentAbility": null, + "downhilling": 70, + "endurance": 66, + "firstName": "Bas", + "hill": 64, + "id": 6072, + "lastName": "Van Der Kooij", + "mediumMountain": null, + "mountain": 59, + "plain": 70, + "prologue": 63, + "recuperation": 64, + "resistance": 64, + "sprint": 74, + "timeTrial": 59, + }, + ], +} +`; + +exports[`searchCyclist > finds cyclists by last name for Pro cycling manager 2021 1`] = ` +{ + "cyclists": [ + { + "acceleration": 75, + "baroudeur": 65, + "cobble": 73, + "country": "BEL", + "currentAbility": null, + "downhilling": 75, + "endurance": 70, + "firstName": "Tosh", + "hill": 73, + "id": 2548, + "lastName": "Van der Sande", + "mediumMountain": null, + "mountain": 62, + "plain": 73, + "prologue": 65, + "recuperation": 68, + "resistance": 68, + "sprint": 73, + "timeTrial": 65, + }, + { + "acceleration": 69, + "baroudeur": 61, + "cobble": 65, + "country": "NED", + "currentAbility": null, + "downhilling": 67, + "endurance": 69, + "firstName": "Nick", + "hill": 72, + "id": 3396, + "lastName": "Van Der Lijke", + "mediumMountain": null, + "mountain": 64, + "plain": 71, + "prologue": 67, + "recuperation": 68, + "resistance": 69, + "sprint": 66, + "timeTrial": 63, + }, + { + "acceleration": 69, + "baroudeur": 75, + "cobble": 72, + "country": "NED", + "currentAbility": null, + "downhilling": 72, + "endurance": 70, + "firstName": "Taco", + "hill": 68, + "id": 3871, + "lastName": "Van Der Hoorn", + "mediumMountain": null, + "mountain": 59, + "plain": 76, + "prologue": 62, + "recuperation": 69, + "resistance": 69, + "sprint": 65, + "timeTrial": 62, + }, + { + "acceleration": 72, + "baroudeur": 69, + "cobble": 63, + "country": "NED", + "currentAbility": null, + "downhilling": 63, + "endurance": 61, + "firstName": "Nick", + "hill": 59, + "id": 3968, + "lastName": "Van Der Meer", + "mediumMountain": null, + "mountain": 54, + "plain": 69, + "prologue": 63, + "recuperation": 61, + "resistance": 60, + "sprint": 71, + "timeTrial": 60, + }, + { + "acceleration": 72, + "baroudeur": 61, + "cobble": 64, + "country": "NED", + "currentAbility": null, + "downhilling": 75, + "endurance": 57, + "firstName": "Maik", + "hill": 60, + "id": 5920, + "lastName": "Van Der Heijden", + "mediumMountain": null, + "mountain": 54, + "plain": 65, + "prologue": 66, + "recuperation": 58, + "resistance": 59, + "sprint": 69, + "timeTrial": 64, + }, + { + "acceleration": 61, + "baroudeur": 68, + "cobble": 56, + "country": "NED", + "currentAbility": null, + "downhilling": 61, + "endurance": 58, + "firstName": "Mel", + "hill": 62, + "id": 6025, + "lastName": "Van Der Veekens", + "mediumMountain": null, + "mountain": 59, + "plain": 64, + "prologue": 61, + "recuperation": 52, + "resistance": 56, + "sprint": 57, + "timeTrial": 58, + }, + { + "acceleration": 76, + "baroudeur": 67, + "cobble": 65, + "country": "NED", + "currentAbility": null, + "downhilling": 70, + "endurance": 66, + "firstName": "Bas", + "hill": 64, + "id": 6072, + "lastName": "Van Der Kooij", + "mediumMountain": null, + "mountain": 59, + "plain": 70, + "prologue": 63, + "recuperation": 69, + "resistance": 64, + "sprint": 74, + "timeTrial": 59, + }, + { + "acceleration": 64, + "baroudeur": 66, + "cobble": 61, + "country": "NED", + "currentAbility": null, + "downhilling": 65, + "endurance": 59, + "firstName": "Dennis", + "hill": 64, + "id": 6085, + "lastName": "Van der Horst", + "mediumMountain": null, + "mountain": 57, + "plain": 67, + "prologue": 61, + "recuperation": 62, + "resistance": 59, + "sprint": 66, + "timeTrial": 61, + }, + { + "acceleration": 62, + "baroudeur": 64, + "cobble": 60, + "country": "NED", + "currentAbility": null, + "downhilling": 65, + "endurance": 59, + "firstName": "Danny", + "hill": 67, + "id": 6461, + "lastName": "Van Der Tuuk", + "mediumMountain": null, + "mountain": 63, + "plain": 66, + "prologue": 63, + "recuperation": 63, + "resistance": 61, + "sprint": 61, + "timeTrial": 63, + }, + { + "acceleration": 84, + "baroudeur": 69, + "cobble": 82, + "country": "NED", + "currentAbility": null, + "downhilling": 84, + "endurance": 82, + "firstName": "Mathieu", + "hill": 80, + "id": 6764, + "lastName": "Van Der Poel", + "mediumMountain": null, + "mountain": 65, + "plain": 83, + "prologue": 77, + "recuperation": 70, + "resistance": 81, + "sprint": 79, + "timeTrial": 68, + }, + ], +} +`; + +exports[`searchCyclist > finds cyclists by last name for Pro cycling manager 2025 1`] = ` +{ + "cyclists": [ + { + "acceleration": 68, + "baroudeur": 65, + "cobble": 72, + "country": "BEL", + "currentAbility": 0, + "downhilling": 75, + "endurance": 65, + "firstName": "Tosh", + "hill": 70, + "id": 2548, + "lastName": "Van Der Sande", + "mediumMountain": 67, + "mountain": 64, + "plain": 71, + "prologue": 65, + "recuperation": 68, + "resistance": 66, + "sprint": 68, + "timeTrial": 65, + }, + { + "acceleration": 69, + "baroudeur": 80, + "cobble": 72, + "country": "NED", + "currentAbility": 0, + "downhilling": 72, + "endurance": 72, + "firstName": "Taco", + "hill": 69, + "id": 3871, + "lastName": "Van Der Hoorn", + "mediumMountain": 64, + "mountain": 59, + "plain": 74, + "prologue": 62, + "recuperation": 67, + "resistance": 69, + "sprint": 65, + "timeTrial": 62, + }, + { + "acceleration": 72, + "baroudeur": 69, + "cobble": 65, + "country": "NED", + "currentAbility": 0, + "downhilling": 63, + "endurance": 62, + "firstName": "Nick", + "hill": 59, + "id": 3968, + "lastName": "Van Der Meer", + "mediumMountain": 57, + "mountain": 54, + "plain": 69, + "prologue": 63, + "recuperation": 61, + "resistance": 62, + "sprint": 70, + "timeTrial": 60, + }, + { + "acceleration": 64, + "baroudeur": 66, + "cobble": 61, + "country": "NED", + "currentAbility": 0, + "downhilling": 65, + "endurance": 59, + "firstName": "Dennis", + "hill": 64, + "id": 6085, + "lastName": "Van Der Horst", + "mediumMountain": 61, + "mountain": 57, + "plain": 67, + "prologue": 61, + "recuperation": 62, + "resistance": 59, + "sprint": 66, + "timeTrial": 61, + }, + { + "acceleration": 61, + "baroudeur": 64, + "cobble": 64, + "country": "POL", + "currentAbility": 0, + "downhilling": 65, + "endurance": 60, + "firstName": "Danny", + "hill": 66, + "id": 6461, + "lastName": "Van Der Tuuk", + "mediumMountain": 64, + "mountain": 62, + "plain": 67, + "prologue": 65, + "recuperation": 63, + "resistance": 61, + "sprint": 60, + "timeTrial": 65, + }, + { + "acceleration": 81, + "baroudeur": 76, + "cobble": 82, + "country": "NED", + "currentAbility": 0, + "downhilling": 84, + "endurance": 83, + "firstName": "Mathieu", + "hill": 79, + "id": 6764, + "lastName": "Van Der Poel", + "mediumMountain": 66, + "mountain": 61, + "plain": 83, + "prologue": 78, + "recuperation": 70, + "resistance": 82, + "sprint": 75, + "timeTrial": 75, + }, + { + "acceleration": 56, + "baroudeur": 67, + "cobble": 57, + "country": "NED", + "currentAbility": 0, + "downhilling": 60, + "endurance": 56, + "firstName": "Niels", + "hill": 54, + "id": 7503, + "lastName": "Van Der Gracht", + "mediumMountain": 52, + "mountain": 50, + "plain": 63, + "prologue": 56, + "recuperation": 57, + "resistance": 53, + "sprint": 57, + "timeTrial": 58, + }, + { + "acceleration": 66, + "baroudeur": 65, + "cobble": 60, + "country": "BEL", + "currentAbility": 0, + "downhilling": 65, + "endurance": 64, + "firstName": "Aaron", + "hill": 68, + "id": 7605, + "lastName": "Van Der Beken", + "mediumMountain": 68, + "mountain": 66, + "plain": 64, + "prologue": 57, + "recuperation": 68, + "resistance": 63, + "sprint": 60, + "timeTrial": 57, + }, + { + "acceleration": 65, + "baroudeur": 70, + "cobble": 70, + "country": "NED", + "currentAbility": 0, + "downhilling": 70, + "endurance": 66, + "firstName": "Max", + "hill": 69, + "id": 8057, + "lastName": "Van der Meulen", + "mediumMountain": 69, + "mountain": 68, + "plain": 66, + "prologue": 65, + "recuperation": 68, + "resistance": 64, + "sprint": 64, + "timeTrial": 63, + }, + { + "acceleration": 58, + "baroudeur": 72, + "cobble": 64, + "country": "NED", + "currentAbility": 0, + "downhilling": 68, + "endurance": 59, + "firstName": "Jardi", + "hill": 66, + "id": 8321, + "lastName": "Van Der Lee", + "mediumMountain": 65, + "mountain": 65, + "plain": 66, + "prologue": 62, + "recuperation": 60, + "resistance": 61, + "sprint": 59, + "timeTrial": 62, + }, + ], +} +`; diff --git a/test/tools/__snapshots__/search-team.test.ts.snap b/test/tools/__snapshots__/search-team.test.ts.snap new file mode 100644 index 0000000..9ae9736 --- /dev/null +++ b/test/tools/__snapshots__/search-team.test.ts.snap @@ -0,0 +1,65 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`searchTeam > finds teams by name for Pro cycling manager 2018 1`] = ` +{ + "teams": [ + { + "country": "Spain", + "division": "GS1", + "evaluation": 0, + "id": 1, + "manager": "Eusebio Unzue", + "name": "Movistar Team", + "shortName": "Movistar", + }, + ], +} +`; + +exports[`searchTeam > finds teams by name for Pro cycling manager 2019 1`] = ` +{ + "teams": [ + { + "country": "Spain", + "division": "GS1", + "evaluation": 0, + "id": 1, + "manager": "Eusebio Unzue", + "name": "Movistar Team", + "shortName": "Movistar", + }, + ], +} +`; + +exports[`searchTeam > finds teams by name for Pro cycling manager 2021 1`] = ` +{ + "teams": [ + { + "country": "Spain", + "division": "GS1", + "evaluation": 0, + "id": 1, + "manager": "Eusebio Unzue", + "name": "Movistar Team", + "shortName": "Movistar", + }, + ], +} +`; + +exports[`searchTeam > finds teams by name for Pro cycling manager 2025 1`] = ` +{ + "teams": [ + { + "country": "Spain", + "division": "GS1", + "evaluation": 0, + "id": 1, + "manager": "Eusebio Unzue", + "name": "Movistar Team", + "shortName": "Movistar", + }, + ], +} +`; diff --git a/test/tools/get-player-info.test.ts b/test/tools/get-player-info.test.ts new file mode 100644 index 0000000..7717a58 --- /dev/null +++ b/test/tools/get-player-info.test.ts @@ -0,0 +1,32 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { registerGetPlayerInfo } from "../../src/tools/get-player-info"; +import { saveFixtures } from "../fixtures/save.fixture"; +import { createMockMcpServer } from "../mocks/mock-mcp-server"; +import type { MockMcpServer } from "../mocks/mock-mcp-server"; + +describe("getPlayerInfo", () => { + let mcp: MockMcpServer; + + beforeEach(() => { + mcp = createMockMcpServer(); + registerGetPlayerInfo(mcp.server); + }); + + it("registers the pcm_get_player_info tool", () => { + expect(mcp.getTool("pcm_get_player_info")).toBeDefined(); + expect(mcp.registerTool).toHaveBeenCalledOnce(); + }); + + // The official-release fixtures are databases, not played careers, so they + // have no active human player (GAM_user.game_i_active = 1). The tool should + // surface that as a graceful error rather than throwing. + it.each( + saveFixtures, + )("errors when there is no active player for %s", async (name, path) => { + const result = await mcp.callTool("pcm_get_player_info", { + savePath: path, + }); + + expect(result.isError).toBe(true); + }); +}); diff --git a/test/tools/get-save-schema.test.ts b/test/tools/get-save-schema.test.ts new file mode 100644 index 0000000..2869f34 --- /dev/null +++ b/test/tools/get-save-schema.test.ts @@ -0,0 +1,28 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { registerGetSaveSchema } from "../../src/tools/get-save-schema"; +import { createMockMcpServer } from "../mocks/mock-mcp-server"; +import type { MockMcpServer } from "../mocks/mock-mcp-server"; +import { saveFixtures } from "../fixtures/save.fixture"; + +describe("getSaveSchema", () => { + let mcp: MockMcpServer; + + beforeEach(() => { + mcp = createMockMcpServer(); + registerGetSaveSchema(mcp.server); + }); + + it("registers the pcm_get_save_schema tool", () => { + expect(mcp.getTool("pcm_get_save_schema")).toBeDefined(); + expect(mcp.registerTool).toHaveBeenCalledOnce(); + }); + + it.each(saveFixtures)("returns save schema for %s", async (name, path) => { + const result = await mcp.callTool("pcm_get_save_schema", { + savePath: path, + }); + + expect(result.structuredContent).toBeDefined(); + expect(result.structuredContent).toMatchSnapshot(); + }); +}); diff --git a/test/tools/get-table-schema.test.ts b/test/tools/get-table-schema.test.ts new file mode 100644 index 0000000..98d4ab5 --- /dev/null +++ b/test/tools/get-table-schema.test.ts @@ -0,0 +1,31 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { registerGetTableSchema } from "../../src/tools/get-table-schema"; +import { createMockMcpServer } from "../mocks/mock-mcp-server"; +import type { MockMcpServer } from "../mocks/mock-mcp-server"; +import { saveFixtures } from "../fixtures/save.fixture"; + +describe("getTableSchema", () => { + let mcp: MockMcpServer; + + beforeEach(() => { + mcp = createMockMcpServer(); + registerGetTableSchema(mcp.server); + }); + + it("registers the pcm_get_table_schema tool", () => { + expect(mcp.getTool("pcm_get_table_schema")).toBeDefined(); + expect(mcp.registerTool).toHaveBeenCalledOnce(); + }); + + it.each( + saveFixtures, + )("returns STA_race table schema for %s", async (name, path) => { + const result = await mcp.callTool("pcm_get_table_schema", { + savePath: path, + tableName: "STA_race", + }); + + expect(result.structuredContent).toBeDefined(); + expect(result.structuredContent).toMatchSnapshot(); + }); +}); diff --git a/test/tools/get-team-roster.test.ts b/test/tools/get-team-roster.test.ts new file mode 100644 index 0000000..a3c0f53 --- /dev/null +++ b/test/tools/get-team-roster.test.ts @@ -0,0 +1,40 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { registerGetTeamRoster } from "../../src/tools/get-team-roster"; +import { saveFixtures } from "../fixtures/save.fixture"; +import { createMockMcpServer } from "../mocks/mock-mcp-server"; +import type { MockMcpServer } from "../mocks/mock-mcp-server"; + +describe("getTeamRoster", () => { + let mcp: MockMcpServer; + + beforeEach(() => { + mcp = createMockMcpServer(); + registerGetTeamRoster(mcp.server); + }); + + it("registers the pcm_get_team_roster tool", () => { + expect(mcp.getTool("pcm_get_team_roster")).toBeDefined(); + expect(mcp.registerTool).toHaveBeenCalledOnce(); + }); + + it.each( + saveFixtures, + )("returns the roster for a given team for %s", async (name, path) => { + const result = await mcp.callTool("pcm_get_team_roster", { + savePath: path, + teamId: 1, + }); + + expect(result.structuredContent).toBeDefined(); + expect(result.structuredContent).toMatchSnapshot(); + }); + + it("returns an error for an unknown team", async () => { + const result = await mcp.callTool("pcm_get_team_roster", { + savePath: saveFixtures[0][1], + teamId: 999999, + }); + + expect(result.isError).toBe(true); + }); +}); diff --git a/test/tools/search-cyclist.test.ts b/test/tools/search-cyclist.test.ts new file mode 100644 index 0000000..58594e6 --- /dev/null +++ b/test/tools/search-cyclist.test.ts @@ -0,0 +1,39 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { registerSearchCyclist } from "../../src/tools/search-cyclist"; +import { saveFixtures } from "../fixtures/save.fixture"; +import { createMockMcpServer } from "../mocks/mock-mcp-server"; +import type { MockMcpServer } from "../mocks/mock-mcp-server"; + +describe("searchCyclist", () => { + let mcp: MockMcpServer; + + beforeEach(() => { + mcp = createMockMcpServer(); + registerSearchCyclist(mcp.server); + }); + + it("registers the pcm_search_cyclist tool", () => { + expect(mcp.getTool("pcm_search_cyclist")).toBeDefined(); + expect(mcp.registerTool).toHaveBeenCalledOnce(); + }); + + it.each( + saveFixtures, + )("finds cyclists by last name for %s", async (name, path) => { + const result = await mcp.callTool("pcm_search_cyclist", { + savePath: path, + lastName: "van der", + }); + + expect(result.structuredContent).toBeDefined(); + expect(result.structuredContent).toMatchSnapshot(); + }); + + it("returns an error when neither name is provided", async () => { + const result = await mcp.callTool("pcm_search_cyclist", { + savePath: saveFixtures[0][1], + }); + + expect(result.isError).toBe(true); + }); +}); diff --git a/test/tools/search-team.test.ts b/test/tools/search-team.test.ts new file mode 100644 index 0000000..449eeab --- /dev/null +++ b/test/tools/search-team.test.ts @@ -0,0 +1,38 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { registerSearchTeam } from "../../src/tools/search-team"; +import { saveFixtures } from "../fixtures/save.fixture"; +import { createMockMcpServer } from "../mocks/mock-mcp-server"; +import type { MockMcpServer } from "../mocks/mock-mcp-server"; + +describe("searchTeam", () => { + let mcp: MockMcpServer; + + beforeEach(() => { + mcp = createMockMcpServer(); + registerSearchTeam(mcp.server); + }); + + it("registers the pcm_search_team tool", () => { + expect(mcp.getTool("pcm_search_team")).toBeDefined(); + expect(mcp.registerTool).toHaveBeenCalledOnce(); + }); + + it.each(saveFixtures)("finds teams by name for %s", async (name, path) => { + const result = await mcp.callTool("pcm_search_team", { + savePath: path, + name: "movistar", + }); + + expect(result.structuredContent).toBeDefined(); + expect(result.structuredContent).toMatchSnapshot(); + }); + + it("returns an error when the name is empty", async () => { + const result = await mcp.callTool("pcm_search_team", { + savePath: saveFixtures[0][1], + name: " ", + }); + + expect(result.isError).toBe(true); + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 4a7a2a6..19af480 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,6 @@ "module": "preserve", "moduleResolution": "bundler", "noEmit": true, - "rootDir": "./src", "strict": true, "esModuleInterop": true, "skipLibCheck": true, diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 0000000..85ad1f5 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "noEmit": true, + "declaration": false, + "declarationMap": false, + "types": ["node"] + }, + "include": ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"], + "exclude": ["node_modules", "dist"] +}