mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
28 lines
842 B
JavaScript
28 lines
842 B
JavaScript
import "../js/parser.js";
|
|
import "../js/utils.js";
|
|
|
|
function testCatIds () {
|
|
const errors = [];
|
|
Object.keys(Parser.CAT_ID_TO_FULL).forEach(catId => {
|
|
if (Parser.CAT_ID_TO_PROP[catId] === undefined) errors.push(`Missing property for ID: ${catId} (${Parser.CAT_ID_TO_FULL[catId]})`);
|
|
if (UrlUtil.CAT_TO_PAGE[catId] === undefined) errors.push(`Missing page for ID: ${catId} (${Parser.CAT_ID_TO_FULL[catId]})`);
|
|
});
|
|
return errors;
|
|
}
|
|
|
|
async function main () {
|
|
let anyErrors = false;
|
|
|
|
const errorsCatIds = testCatIds();
|
|
if (errorsCatIds.length) {
|
|
anyErrors = true;
|
|
console.error(`Category ID errors:`);
|
|
errorsCatIds.forEach(it => console.error(`\t${it}`));
|
|
}
|
|
|
|
if (!anyErrors) console.log("##### Misc Tests Passed #####");
|
|
return !anyErrors; // invert the result as this is what the test runner expects
|
|
}
|
|
|
|
export default main();
|