portfolio/test/config/Testimonials.spec.ts

27 lines
694 B
TypeScript
Raw Permalink Normal View History

/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { describe, it, expect } from "vitest";
import { Testimonials } from "../../src/config/Testimonials";
describe("testimonial objects", () => {
it("should have unique names", () => {
expect.assertions(1);
const set = new Set(
Testimonials.map((t) => {
return t.name;
}),
);
expect(set, "are not unique").toHaveLength(Testimonials.length);
});
it("should have no future dates", () => {
expect.assertions(1);
expect(Testimonials.filter((t) => {
return new Date(t.date) > new Date();
}), "have future dates").toHaveLength(0);
});
});