From e9ce37cf5eeecf4275a0ec5d5d74a4364605a201 Mon Sep 17 00:00:00 2001 From: zkldi Date: Thu, 24 Jun 2021 20:41:10 +0100 Subject: [PATCH] ok for real this time --- .../lib/score-import/framework/calculated-data/stats.test.ts | 1 + server/src/lib/score-import/framework/goals/goals.test.ts | 5 ++++- .../router/api/v1/games/_game/_playtype/router.test.ts | 3 +++ server/src/utils/folder.test.ts | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/server/src/lib/score-import/framework/calculated-data/stats.test.ts b/server/src/lib/score-import/framework/calculated-data/stats.test.ts index c1eb09791..cf3178c66 100644 --- a/server/src/lib/score-import/framework/calculated-data/stats.test.ts +++ b/server/src/lib/score-import/framework/calculated-data/stats.test.ts @@ -426,6 +426,7 @@ t.test("#CalculateLampRating", (t) => { }); t.test("TierlistData edge cases", async (t) => { + await db["tierlist-data"].remove({ chartID: Testing511SPA.chartID, key: "CLEAR" }); // mock document that implies 5.1.1. SPA is worth 11.9 to NC and 10.6 to HC. await db["tierlist-data"].insert({ chartID: Testing511SPA.chartID, diff --git a/server/src/lib/score-import/framework/goals/goals.test.ts b/server/src/lib/score-import/framework/goals/goals.test.ts index 3ca355d70..0a70f38d7 100644 --- a/server/src/lib/score-import/framework/goals/goals.test.ts +++ b/server/src/lib/score-import/framework/goals/goals.test.ts @@ -60,7 +60,10 @@ t.test("#GetRelevantFolderGoals", (t) => { t.beforeEach(async () => { // @ts-expect-error garbage types - const sp11folder = deepmerge(TestingIIDXFolderSP10, { data: { level: "11" } }); + const sp11folder = deepmerge(TestingIIDXFolderSP10, { + data: { level: "11" }, + folderID: "foo", + }); await db.folders.insert(TestingIIDXFolderSP10); await db.folders.insert(sp11folder); await db.goals.insert(fakeFolderGoalDocument); diff --git a/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts b/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts index 36338b002..e2cb601d5 100644 --- a/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts +++ b/server/src/server/router/api/v1/games/_game/_playtype/router.test.ts @@ -1,6 +1,7 @@ import t from "tap"; import mockApi from "../../../../../../../test-utils/mock-api"; import { GetGamePTConfig } from "tachi-common"; +import { CloseAllConnections } from "../../../../../../../test-utils/close-connections"; t.test("GET /api/v1/games/:game/:playtype", (t) => { t.test("Should return information about the game:playtype.", async (t) => { @@ -23,3 +24,5 @@ t.test("GET /api/v1/games/:game/:playtype", (t) => { t.end(); }); + +t.teardown(CloseAllConnections); diff --git a/server/src/utils/folder.test.ts b/server/src/utils/folder.test.ts index 5c1d6be00..16210f698 100644 --- a/server/src/utils/folder.test.ts +++ b/server/src/utils/folder.test.ts @@ -120,6 +120,9 @@ t.test("#ResolveFolderToCharts", (t) => { deepmerge(Testing511SPA, { difficulty: "NORMAL", chartID: "FAKE_511_SPN", + data: { + arcChartID: "uniqueid", + }, }) as ChartDocument<"iidx:SP"> );