Files
zkldi_Tachi/seeds/scripts/test/folder-id.test.ts
T
zk 593adb2717 feat: Dev Container (#1149)
* temporary dvctr

* start of work

* fix: timeouts in windows

* fish?

* feat: better, working stuff

* refactor: rename database-seeds to seeds/

* better

* fdsaf

* feat: don't let our container get owned by root

* fix: better user handling

* feat: falling asleep at my desk i yield to you what i have done

* feat: autoadminify

* docs: denote trickshot

* feat: open in browser on launch

* better seeds workings...

* fix: dont kill shell

* docs: mention dev/debs

* fix: whoops

* fix: make seeds load within the century

* feat: rest of the containerisation

* feat: new alias

* style: fix linter errors

* fix: bad call

* fix: better justfile
2024-08-17 15:01:40 +01:00

38 lines
953 B
TypeScript

import chalk from "chalk";
import { FolderDocument } from "tachi-common";
import { CreateFolderID, ReadCollection } from "../util";
import { FormatFunctions } from "./test-utils";
let success = 0;
let fails = 0;
const folders = ReadCollection("folders.json", true) as FolderDocument[];
for (const folder of folders) {
const pretty = FormatFunctions.folders!(folder, null);
const expectedFolderID = CreateFolderID(folder.data, folder.game, folder.playtype);
if (expectedFolderID !== folder.folderID) {
console.error(
chalk.red(
`[ERR] | ${pretty} | Expected folderID to be ${expectedFolderID}. Got ${folder.folderID}.`
)
);
fails++;
} else {
success++;
}
}
console.log(chalk[fails === 0 ? "green" : "red"](`[FOLDER_ID]: ${success} good, ${fails} bad.`));
if (fails !== 0) {
console.log(
chalk.yellow("Run scripts/rerunners/fix-folder-ids.js to automatically fix these issues.")
);
}
process.exit(fails !== 0 ? 1 : 0);