mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-27 09:28:12 +03:00
Always flush foldercache in tests
This commit is contained in:
@@ -65,8 +65,8 @@ t.test("#GetRelevantFolderGoals", (t) => {
|
||||
await db.folders.insert(sp11folder);
|
||||
await db.goals.insert(fakeFolderGoalDocument);
|
||||
await db.goals.insert(notFolderGoalDocument);
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10);
|
||||
await CreateFolderChartLookup(sp11folder);
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
|
||||
await CreateFolderChartLookup(sp11folder, true);
|
||||
});
|
||||
|
||||
t.test("Should correctly find the goals on this folder.", async (t) => {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { IIDX_LAMPS } from "tachi-common";
|
||||
|
||||
t.test("#EvaluateShowcaseStat", (t) => {
|
||||
t.beforeEach(ResetDBState);
|
||||
t.beforeEach(async () => await CreateFolderChartLookup(TestingIIDXFolderSP10));
|
||||
t.beforeEach(async () => await CreateFolderChartLookup(TestingIIDXFolderSP10, true));
|
||||
t.beforeEach(
|
||||
async () => await db["personal-bests"].insert(deepmerge(TestingIIDXSPScorePB, {}))
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@ t.test("#EvalulateUsersStatsShowcase", (t) => {
|
||||
|
||||
t.beforeEach(async () => {
|
||||
await db.folders.insert(TestingIIDXFolderSP10);
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10);
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
|
||||
|
||||
await db["game-settings"].remove({});
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ t.test("#EvaluateGoalForUser", (t) => {
|
||||
}),
|
||||
]);
|
||||
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10);
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
|
||||
});
|
||||
|
||||
t.test("Should work if 511 is >= HARD CLEAR", async (t) => {
|
||||
|
||||
@@ -54,7 +54,7 @@ t.test("GET /api/v1/games/:game/:playtype/folders/:folderID", (t) => {
|
||||
|
||||
t.test("Should return the folder at this ID.", async (t) => {
|
||||
await db.folders.insert(deepmerge(mockFolder, {}));
|
||||
await CreateFolderChartLookup(mockFolder);
|
||||
await CreateFolderChartLookup(mockFolder, true);
|
||||
|
||||
const res = await mockApi.get("/api/v1/games/iidx/SP/folders/foo");
|
||||
|
||||
|
||||
+3
-3
@@ -20,7 +20,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/folders/:folderID", (t)
|
||||
folderID: "testing_folder",
|
||||
}) as FolderDocument;
|
||||
await db.folders.insert(folder);
|
||||
await CreateFolderChartLookup(folder);
|
||||
await CreateFolderChartLookup(folder, true);
|
||||
await db["personal-bests"].insert(deepmerge(TestingIIDXSPScorePB, {}));
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/folders/:folderID/timeli
|
||||
t.beforeEach(ResetDBState);
|
||||
t.beforeEach(async () => {
|
||||
await db.folders.insert(folder);
|
||||
await CreateFolderChartLookup(folder);
|
||||
await CreateFolderChartLookup(folder, true);
|
||||
await db["personal-bests"].insert(deepmerge(TestingIIDXSPScorePB, {}));
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/folders/:folderID/timeli
|
||||
await db.songs.iidx.insert(GetKTDataJSON("./tachi/tachi-songs-iidx.json"));
|
||||
await db.charts.iidx.insert(GetKTDataJSON("./tachi/tachi-charts-iidx.json"));
|
||||
|
||||
await CreateFolderChartLookup(folder);
|
||||
await CreateFolderChartLookup(folder, true);
|
||||
|
||||
await db.scores.insert([
|
||||
deepmerge(TestingIIDXSPScore, {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import { CreateFolderChartLookup } from "utils/folder";
|
||||
|
||||
const SetFolders = async () => {
|
||||
await db.folders.insert(TestingIIDXFolderSP10);
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10);
|
||||
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
|
||||
|
||||
await db["game-settings"].remove({});
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/tables/:tableID", (t) =>
|
||||
}) as FolderDocument;
|
||||
await db.folders.insert(folder);
|
||||
|
||||
await CreateFolderChartLookup(folder);
|
||||
await CreateFolderChartLookup(folder, true);
|
||||
|
||||
await db["personal-bests"].insert(TestingIIDXSPScorePB);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user