generated from nhcarrigan/template
Some checks failed
Node.js CI / Lint and Test (pull_request) Failing after 52s
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
/**
|
|
* @copyright nhcarrigan
|
|
* @license Naomi's Public License
|
|
* @author Naomi Carrigan
|
|
*/
|
|
import { describe, it, expect } from "vitest";
|
|
import { Characters } from "../../src/config/Legacy";
|
|
|
|
describe("character objects", () => {
|
|
it("should have unique names", () => {
|
|
expect.assertions(1);
|
|
const set = new Set(
|
|
Object.values(Characters).map((c) => {
|
|
return c.name;
|
|
}),
|
|
);
|
|
expect(set, "are not unique").toHaveLength(Object.values(Characters).length);
|
|
});
|
|
|
|
it("should not have empty bios", () => {
|
|
expect.assertions(1);
|
|
const noBio = Object.values(Characters).filter((c) => {
|
|
return c.bio.length === 0;
|
|
});
|
|
expect(noBio, "found missing bio").toHaveLength(0);
|
|
});
|
|
|
|
it("should not have empty combat profiles", () => {
|
|
expect.assertions(1);
|
|
const noCombat = Object.values(Characters).filter((c) => {
|
|
return c.combat.length === 0;
|
|
});
|
|
expect(noCombat, "found missing combat").toHaveLength(0);
|
|
});
|
|
|
|
it("should have alt text", () => {
|
|
expect.assertions(1);
|
|
const noText = Object.values(Characters).filter((c) => {
|
|
return c.alt.length === 0;
|
|
});
|
|
expect(noText, "found missing alt").toHaveLength(0);
|
|
});
|
|
});
|