test todos

This commit is contained in:
zkldi
2021-05-09 22:02:58 +01:00
parent 34bd38252f
commit 4eec8a7712
9 changed files with 76 additions and 3 deletions
@@ -0,0 +1,20 @@
import t from "tap";
import { CreateImportLoggerAndID } from "./import-logger";
import { PublicUserDocument } from "kamaitachi-common";
import { Logger } from "winston";
t.test("#CreateImportLoggerAndID", (t) => {
let { importID, logger } = CreateImportLoggerAndID(
{ username: "foo", id: 1 } as PublicUserDocument,
"file/csv:eamusement-iidx"
);
t.match(importID, /^[a-f0-9]{40}$/u, "Should return a 40 character importID.");
// not possible to automate this, probably.
logger.info(
"Namespaced log test - if this does not have 'file/csv:eamusement-iidx | foo (#1)' next to it, it's broke."
);
t.end();
});
@@ -0,0 +1,12 @@
import t from "tap";
import { CloseMongoConnection } from "../../../db/db";
import ResetDBState from "../../../test-utils/reset-db-state";
import { UpdateUsersMilestones } from "./milestones";
t.todo("#UpdateUsersMilestones", (t) => {
t.beforeEach(ResetDBState);
t.end();
});
t.teardown(CloseMongoConnection);
@@ -0,0 +1,6 @@
import t from "tap";
import { HydrateScore } from "./hydrate-score";
t.todo("#HydrateScore", (t) => {
t.end();
});
@@ -5,7 +5,6 @@ import {
ScoreDocument,
AnySongDocument,
} from "kamaitachi-common";
import { Logger } from "winston";
import { DryScore, KtLogger } from "../../../types";
import { CreateCalculatedData } from "../calculated-data/calculated-data";
@@ -14,7 +13,7 @@ import { CreateCalculatedData } from "../calculated-data/calculated-data";
* @param dryScore The intermediate score to make into a real score.
* @param userID The userID this score is for.
*/
export default async function HydrateScore(
export async function HydrateScore(
userID: integer,
dryScore: DryScore,
chart: AnyChartDocument,
@@ -0,0 +1,10 @@
import t from "tap";
import { ImportAllIterableData, ImportIterableDatapoint } from "./score-importing";
t.todo("#ImportAllIterableData", (t) => {
t.end();
});
t.todo("#ImportIterableDatapoint", (t) => {
t.end();
});
@@ -6,7 +6,7 @@ import {
AnySongDocument,
} from "kamaitachi-common";
import { DryScore, ConverterFunction, ConverterFnReturn, KtLogger } from "../../../types";
import HydrateScore from "./hydrate-score";
import { HydrateScore } from "./hydrate-score";
import { InsertQueue, QueueScoreInsert, ScoreIDs } from "./insert-score";
import {
ConverterFailure,
@@ -0,0 +1,10 @@
import t from "tap";
import { GenerateRandomSessionName } from "./name-generation";
t.test("#GenerateRandomSessionName", (t) => {
let res = GenerateRandomSessionName();
t.type(res, "string", "Should return a string.");
t.end();
});
@@ -0,0 +1,6 @@
import t from "tap";
import { CreateSessionCalcData } from "./performance-calc";
t.todo("#CreateSessionCalcData", (t) => {
t.end();
});
@@ -0,0 +1,10 @@
import t from "tap";
import { CreateSessions, LoadScoresIntoSessions } from "./sessions";
t.todo("#CreateSessions", (t) => {
t.end();
});
t.todo("#LoadScoresIntoSessions", (t) => {
t.end();
});