diff --git a/src/lib/validate.js b/src/lib/validate.js index edbb61a..7383b92 100644 --- a/src/lib/validate.js +++ b/src/lib/validate.js @@ -32,5 +32,4 @@ export default (array, categories) => { if (uniqueCategoryNames.size !== categories.length) { throw new TypeError("categories must have unique names"); } - return true; }; diff --git a/src/lib/validate.test.js b/src/lib/validate.test.js index 5900cb2..b691cd2 100644 --- a/src/lib/validate.test.js +++ b/src/lib/validate.test.js @@ -7,8 +7,9 @@ test("arguments are validated", () => { { name: "Taxi", type: "Bird" }, ]; const categories = [{ name: "cats", filter: ({ type }) => type === "Cat" }]; - const validatedArgs = validate(array, categories); - expect(validatedArgs).toBe(true); + expect(() => { + validate(array, categories); + }).not.toThrow(); }); test("array is required", () => {