portfolio/test/config/VRoid.spec.ts

37 lines
843 B
TypeScript
Raw Permalink Normal View History

/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { describe, it, expect } from "vitest";
import { MainVRoid, VRoid } from "../../src/config/Vroid";
const concatenated = [
MainVRoid,
...VRoid.sort((a, b) => {
return a.name.localeCompare(b.name);
}),
];
describe("vroid objects", () => {
it("should have unique names", () => {
expect.assertions(1);
const set = new Set(
concatenated.map((a) => {
return a.name;
}),
);
expect(set, "are not unique").toHaveLength(concatenated.length);
});
it("should have unique file properties", () => {
expect.assertions(1);
const set = new Set(
concatenated.map((a) => {
return a.file;
}),
);
expect(set, "are not unique").toHaveLength(concatenated.length);
});
});