From 58bff1e43e1adf8798b5a13882f0a572ad3cd372 Mon Sep 17 00:00:00 2001 From: EthanThatOneKid <31261035+EthanThatOneKid@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:46:41 -0700 Subject: [PATCH] fix test steps Fix test steps `getLatestSeason`, `listSeasons , and `getSeason`. --- lib/leaderboard/denokv/denokv_leaderboard_client.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/leaderboard/denokv/denokv_leaderboard_client.ts b/lib/leaderboard/denokv/denokv_leaderboard_client.ts index ffd97c3..bdbf931 100644 --- a/lib/leaderboard/denokv/denokv_leaderboard_client.ts +++ b/lib/leaderboard/denokv/denokv_leaderboard_client.ts @@ -163,9 +163,17 @@ export class DenoKvLeaderboardClient implements LeaderboardClient { const players = await this.listPlayers(); season = await sync({ lcClient: this.lc, players, season }); + // Store the synced season. + await this.kv.set( + [LeaderboardKvPrefix.SEASONS, season.id], + season, + ); + // Update the season if it is the latest season. + const startOfWeekDate = new Date(startOfWeekUTC); + const seasonStartDate = new Date(season.start_date); const isLatestSeason = - new Date(startOfWeekUTC) === new Date(season.start_date); + startOfWeekDate.getTime() === seasonStartDate.getTime(); if (isLatestSeason) { await this.updateLatestSeason(season, seasonResult); }